0 pts.
 order by column number?
SQL
Can you order by a column number, if so, what's the syntax?

Software/Hardware used:
ASKED: June 7, 2004  6:13 PM
UPDATED: August 8, 2010  11:37 AM

Answer Wiki:
If you are using SQL, you can order by the column position of the returned set. EG., the statement: SELECT Something, SomethingElse FROM MyTable ORDER BY 1 <b>NOTE:</b> THE POSITION OF THE COLUMN IS THE POSITION IN THE PROJECTION LIST BUT NOT IN THE PHYSICAL TABLE
Last Wiki Answer Submitted:  August 8, 2010  11:37 am  by  SloopJohnB   0 pts.
All Answer Wiki Contributors:  SloopJohnB   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If you are using SQL, you can order by the column position of the returned set.

EG., the statement:
SELECT Something, SomethingElse
FROM MyTable
ORDER BY 1

Will order by the Something column. If you are doing a Select *, then the number will refer to the column position in the returned table.

 0 pts.