I would like to order a select by more then one criteria depending on the data retrieved. If I am not mistaken I need to use a case statement but am having some trouble with it.
(fictional select but you get the idea) In this case I would like the transactions with a status of ‘C’ and amount grater then 1000 to be listed first and alphabetically by last name. If the transaction status is ‘C’ but the amount is less then 1000, I would like these listed below the first group alphabetically by last name.
This is what I think that I need…will this work?
a.first_name, a.last_name, t.amount
address a, transaction t
WHEN t.amount > 1000
THEN t.amount, a.last_name
I am getting “Inconsistent Data Type” after the ELSE expression is read???