select CategoryName
from Category where CatId IN (55,568,5412,8991,928,3213,142,9250,12330,2983)
I WANT RECORD TO BE RETRIVE IN SAME ORDER AS (55,568,5412,8991,928,3213,142,9250,12330,2983)
BUT I AM GETTING SOME ANOTHER RANDOM ORDER
CUSTOMIZE ORDERING IN SQL
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manikavelu VelayuthamRank #413 · 6K reputationPosted Oct 6, 2011, 10:41 PM EDT
You have to implement a new logic here to retrieve it in same order as you specified above.
Amol183 reputationPosted Oct 7, 2011, 4:29 AM EDT
select *
from ProductGroups
where GroupID in (24,12,7,14,65)
order by case GroupId
when 7 then 1 -- First in ordering
when 14 then 2 -- Second
else 3
end