Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2003-02-20 : 13:29:17
|
| I have the following recordset:dir code statusabc x activeabc c obsoleteabc r obsoletedef f obsoletedef g obsoleteghj t activeghj x obsoleteI want to select only the records where the status is obsolete for all of the records with the same dir. I should end up with:dirdefThanks in Advance,Lane |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-02-20 : 13:56:14
|
| select dirfrom tablegroup by dirhaving COUNT(*) = sum(CASE WHEN status = 'obsolete' THEN 1 ELSE 0 END)- Jeff |
 |
|
|
|
|
|