You might even consider a subquery to get those two id values:

SELECT * FROM judges
ORDER BY CASE WHEN judge_id IN (
        SELECT id
        FROM users
        WHERE some criteria
) THEN 1 ELSE 0 END,
judge_lname

Then you wouldn't have to hard code them.


andy

-----Original Message-----
From: Les Mizzell [mailto:[email protected]] 
Sent: Wednesday, June 30, 2010 4:19 PM
To: cf-talk
Subject: Re: Order By question


Works the charm:

SELECT * FROM judges
ORDER BY CASE WHEN judge_id IN (2589,7555) THEN 1 ELSE 0 END,
judge_lname


Thanks folks...


__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5241 (20100630) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335005
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to