Specific 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
WanamakerStudios
Forum Commoner
Posts: 65
Joined: Thu Nov 30, 2006 7:35 am

Specific ORDER BY

Post by WanamakerStudios »

I have a results set:

Acura
Alfa Romeo
Buick
Chevrolet
Jeep
Subaru
Toyota

And would like to display all of the makes ... but ... would like JEEP to display first. Is there a way I can do a very specific ORDER BY statement to accomplish this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

ORDER BY brand = 'jeep' DESC, brand ASC
WanamakerStudios
Forum Commoner
Posts: 65
Joined: Thu Nov 30, 2006 7:35 am

Post by WanamakerStudios »

Ok. Thanks. I wasnt sure if I could run a compare in an orderby
Post Reply