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)
 What is the easiest way to put a row last in a sor

Author  Topic 

willbourne
Starting Member

7 Posts

Posted - 2005-04-21 : 04:45:38
I have order by on one name column and I want to have one row last. What do I do?

satishdg
Starting Member

10 Posts

Posted - 2005-04-21 : 05:26:16
Create a view with the return data of one row(that is u r required one row).Then write select statement with order by u r required coloumn and union of another select statement that fecth record from the view.Hopefully it gives u r output.

Satish
Go to Top of Page

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2005-04-21 : 06:38:41
[code]
order by case when name = 'Hej hopp ditt feta nylle' then 1 else 0 end,name
[/code]

Change string value as apropriate ;)
Go to Top of Page

willbourne
Starting Member

7 Posts

Posted - 2005-04-21 : 07:40:45
Thank you guys!
Go to Top of Page
   

- Advertisement -