Order By

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Order By

Post by Straterra »

I have a database with music, most of the time by the same Artist..When I get the data, I get it with

Code: Select all

ORDER BY artist
...But, I would also like to alphabetically get the songs by the artists..could I do a

Code: Select all

ORDER BY artist AND songname
?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Code: Select all

order by artist, songname
Simply just add a comma between the fieldnames.
Post Reply