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 TouchToneTommy 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

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a table called WorkOrder. I ran a query that says "SELECT WorkOrder_ID FROM WorkOrder WHERE Order_ID = '16'". This query returns the following:

80
81
82

I run the following query: "SELECT WorkOrder_ID FROM WorkOrder WHERE Order_ID = '16' ORDER BY WorkOrder_ID" and the query returns the following:

80

What's going on here? Any ideas why I am only returning one value when I implement an "order by" ?
 
Did you try running the original query without the ORDER BY clause again? Did you get all WorkOrder_IDs? I am thinking you are running this in a production environment, and the Order_ID changed for 81 & 82. ORDER BY has no influence over the records that are returned, except to sort them.

Dan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top