Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order by an unknow field name

Status
Not open for further replies.

JRBeltman

IS-IT--Management
Feb 5, 2004
290
NL
Hi,
I need to order my tables using a mysql query, but the field name by with to order can differ for each table.

So the query looks like:
select * from $table order by ?????

Is there something like order by COLUMN 0 or PRIMARY KEY?

Cheers

JR
IT = Logic (except for a well known OS where it equals luck) -> Back to the Basics!
 
Oh well,
found out why my idea did not work. The first column is no 1, not 0...

so "select * from $table order by 1" will order the table by the 1st column..

Cheers all

JR
IT = Logic (except for a well known OS where it equals luck) -> Back to the Basics!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top