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
 General SQL Server Forums
 New to SQL Server Programming
 Order By

Author  Topic 

BankOfficerHere
Posting Yak Master

124 Posts

Posted - 2009-02-19 : 22:19:40
I have in column:

Valid
Invalid
Pending

I want it to be in order by Pending.

Is that possible? Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-19 : 22:38:55
what about other values? dont you want to show them at all?

SELECT....FROM Table... ORDER BY CASE WHEN col='Pending' THEN 0 ELSE 1 END
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-02-19 : 22:39:01
select valid,invalid,pending from urtable order by pending
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-19 : 22:44:22
quote:
Originally posted by Nageswar9

select valid,invalid,pending from urtable order by pending


i think he meant valid,invalid,pending are values in a column
Go to Top of Page
   

- Advertisement -