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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hard to explain One order different operations 1

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
Hello,

this is a bit hard to explain, have a file that has two fields order and operation. Each order can have one or more operations.I am trying to write a query that capture the orders that only have one operation. This is what my data looks like
Code:
order	operation
O1234	1111
O1234	1120
O1234	1130
O1234	1160
O1234	1170
O3456	1111
O7890	1111
O7890	1120
O7890	1130
O6543	1111

so my ending query would look like this
Code:
order	operation
O3456	1111
O6543	1111


Thanks in advance!!!
 
capture the orders that only have one operation
SQL:
SELECT [order] FROM yourTable GROUP BY [order] HAVING Count(*)=1

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

that was a very fast, simple and effective solution. Thank you!!!!! you rock!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top