May 2, 2008

Select statement with "order by" clause

SELECT UserId ,FirstName, LastName,PrimaryEmail,Password ,RegistrationDate
FROM [PropertywalaDb].[dbo].[Users]
where [FirstName] like 'brij%'
order by Password, userid


You can see in the image, the result of the above query. First query result is sorted according to 'Password" Field. Then the result set get after sorting is again sorted on the basis of "UserId". The blue highlighted resul is first result set, sorted by Password and UserId. See the image carefully.

No comments:

Search Here...

Popular Posts

Quick Test Professional