Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 show records in order after some records....

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2010-01-18 : 05:27:06
hi,

I have table named with employee

It contains employee name field.
which is having some records like

EmpName
Asif
John
Burhan
Mack
Sima
Joseph


now I want to order by name but the first records must be Asif
then it must be ordered by DESC or ASC

like
empName
Asif
Burhan
John
Joseph
Mack
Sima


Regards,
ASIF

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-01-18 : 05:29:49

order by
case when empname='Asif' then 0 else 1 end, empname

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -