chinmaya parija

chinmaya parija

  • NA
  • 10
  • 12.1k

i do n't under stand the case part of query please help me

Apr 11 2013 8:44 AM
SELECT id, name, city, ImageName, ImagePath
FROM aaaa
ORDER BY CASE WHEN ID > 0 THEN
(SELECT MAX(ID)
FROM [dbo].[aaaa]) + 1 ELSE ID END, id DESC
 

result
id
0
3
2
1

Answers (1)