johnnyg123
asked on
Return records not matching criteria using group by
I have a table that contains text type information for a given case. There can be 1 or more text type for a given case. I am trying to write a query that will return only those case numbers that do not have a text_type of resolution for any of the text types for a given case
Here is some sample data
Case_id Text_Type_Seq Text_Type
1 1 Notes
1 2 Notes
1 3 Resolution
2 1 Notes
2 2 Notes
2 3 Notes
2 4 Notes
3 1 Notes
3 2 Notes
4 1 Notes
4 2 Resolution
Using the sample data above:
The query should only return
Case_ID
2
3
Since case 1 and 4 have a text type of resolution
Here is some sample data
Case_id Text_Type_Seq Text_Type
1 1 Notes
1 2 Notes
1 3 Resolution
2 1 Notes
2 2 Notes
2 3 Notes
2 4 Notes
3 1 Notes
3 2 Notes
4 1 Notes
4 2 Resolution
Using the sample data above:
The query should only return
Case_ID
2
3
Since case 1 and 4 have a text type of resolution
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.