I want my query to bring back one set of results based on a priority value (a,b,c or d).
(all other values sought are standard across all records, which means the only differentiator is the priority column).
Basically bring me back priority 'c' if it is there and if not, bring me back priority 'b'
I think I can only make priority 'c' come back as NULL, if I use a union all query structure. Should that be what I do or is there a more efficient CASE statement , for example.
I guess you'll need more of an idea of what the query is like.
so I need to bring back the results with priority 'b', only if there are no records for priority 'c'.
I'm not sure I understand your need, but if you want the highest priority, and the only changing value is the priority column, you could use MAX and GROUP BY?
, MAX(priority) AS priority
what the heck should we do about priority 'd' then?
This topic is now closed. New replies are no longer allowed.