ibazz — 2013-04-01T12:32:02-04:00 — #1
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.
ibazz — 2013-04-01T12:37:23-04:00 — #2
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'.
guido2004 — 2013-04-01T13:00:57-04:00 — #3
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
r937 — 2013-04-01T15:25:06-04:00 — #4
what the heck should we do about priority 'd' then?