You are here: Re: Order By - problem « PHP SQL « IT news, forums, messages
Re: Order By - problem

Posted by Andy Hassall on 10/05/41 11:26

On Sat, 10 Sep 2005 21:22:23 GMT, hamstring <agent@agent.com> wrote:

>Is it possible to 'order by' 2 columns in a database

Yes, "ORDER BY col1, col2".

>My database only has 2 columns.
>1st column a bit of text
>2nd column a int number
>typically
>
>I want it sorted to
>COL1 COL2
>AA 7
>AD 5
>AZ 5
>BC 5
>AB 2
>AF 1
>
>Any ideas, as I can pnly get 1 column sorted ??

Could you explain your logic behind the sort order you've specified?

It looks like: ORDER BY col2 DESC, col1

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация