Query ... Distinct rows
- From: Wez <Wez@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Jun 2005 03:30:02 -0700
I have a table as follows
ORDER_ID CODE STATUS
1000 XA3 5
1000 XA1 4
1000 XA7 5
1001 X35 5
1001 XA3 5
I want to run a query that will return the distinct ORDER_ID that is Status
= 5. If any records have Status <> 5, I dont want that ORDER_ID returned.
For example above, the result set will be 1001 only (as 1000 has one record
with Status of 4).
I have tried using 'HAVING MIN(Status) = 5 AND MAX(Status = 5) but it doesnt
appear to work :-(
Thanks in advance!
Wez
.
- Follow-Ups:
- Re: Query ... Distinct rows
- From: Hugo Kornelis
- Re: Query ... Distinct rows
- Prev by Date: ODBC vs OLEDB
- Next by Date: Records Duplicating after a Join
- Previous by thread: ODBC vs OLEDB
- Next by thread: Re: Query ... Distinct rows
- Index(es):