I have columns:
CAT | Val
------------
none | 0
high | 5
low | 100
med | 50
as you can see, a low number is category high. (inverse logic) except for 0..
So I want to order by, so that I get the correct order for category. (none, low, med, high).
I want them in order:
CAT | Val
------------
none | 0
low | 100
med | 50
high | 5
I tried this, but it unions, and then orders by. Brackets around each select causes error.
SELECT cat, an_int FROM CATS WHERE an_int = 0
UNION
SELECT cat, an_int FROM CATS WHERE an_int <> 0 ORDER BY an_int DESC
This gives:
CAT | Val
------------
low | 100
med | 50
high | 5
none | 0
try this: