Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order By Clause - can I sort by multiple columns

Status
Not open for further replies.

techkate

Programmer
Feb 23, 2004
118
US
Tried searching previous posts but to no avail.

Is it possible to use the Order By clause to sort by more than one field? If so, what is the syntax for this?

The simplest example that gets my point across:

Code:
SELECT * FROM [Customers]
[i]ORDER BY [Last Name], [First Name][/i]


Thanks for your time.
 
there's nothing wrong with that. Is it not sorting correctly? With that sort order I would expect to see:

Anderson, Anna
Anderson, Bill
Andrews, Alba
Andrews, Leslie
Andrews, Pat
Billings, Bob
Billings, Mary

is that not the results you are getting?

leslie
 
Oops sorry...you're right that is the correct syntax. I guess it is just one of those days. Thanks for your input though, otherwise I would have been chasing a ghost.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top