Pages

Wednesday, January 19, 2011

ORDER BY

ORDER BY

--=============================================[ORDER BY]==================================================================
--Order By is used to sort SQL result sets by some columns

--Order By (default Accending)
SELECT * FROM Person.Contact
ORDER BY ContactID

--Order By (Decending order)
SELECT * FROM Person.Contact
ORDER BY ContactID DESC

--Order By (Ascending order)
SELECT * FROM Person.Contact
ORDER BY ContactID ASC

No comments:

Post a Comment