I have a very large table that is basically structured like this:
Notice that the Category 2 has two records (of type 0 and 1). What I need to do is select a recordset that excludes all 0-type records where its category also has a 1-type. So the result would be:
Note that the Score of the 1-type might not always be larger than the equivalent 0-type. I thought of just grouping on Category using the MAX aggregate function, but that won't always work for score. I need the actual score assigned to the MAX Type (the type of 1). Does that make sense?
I know of ways I could do this with a few joins, but I wanted to see if any of you had a more "finesse" way of achieving this than I was thinking about.
Thanks a lot!
Code:
Category Score Type
1 90 0
2 3 0
2 87 1
3 65 0
Code:
Category Score Type
1 90 0
2 87 1
3 65 0
I know of ways I could do this with a few joins, but I wanted to see if any of you had a more "finesse" way of achieving this than I was thinking about.
Thanks a lot!