Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Order different cols in table

Author  Topic 

makimark
Starting Member

34 Posts

Posted - 2002-06-30 : 09:58:25
Hi
My table has about 25 cols, all different names. Can one order these alphabetically in the result set without having to say "order by col1, col2, col3, etc..." ?

thanks




chadmat
The Chadinator

1974 Posts

Posted - 2002-07-01 : 01:34:43
When you say order the columns alphabetically, do you mean the order in which the columns appear left to right, or the order of the rows returned?

You can say select col1, col4, col13, col2 in any order you want. However, if you want to sort the rows returned, you have to use order by.

-Chad

Go to Top of Page
   

- Advertisement -