sql - How to exclude a group based on one element of another column? -
i have dataset looks this:
claim type 0 1 107444 2 107444 5 107445 2 107446 2
etc...
as result of simple query:
select claim,[type] mytbl group claim,[type] order claim
i want write query excludes claims have type = 5, result of be:
claim type 0 1 107445 2 107446 2
any ideas on how accomplish this?
you can logic in where
clause:
select claim, [type] mytbl claim not in (select claim mytbl [type] = 5)
Comments
Post a Comment