MySql: Advanced sorting 1st row to highest then lowest to highest? -
i need result set this:
first last amount bob nolan 789 bob nolan 0 bob nolan 23 bob nolan 55 mavis li 3030 mavis li 0 mavis li 213 mavis li 449 the first record of person should give me highest amount second , forth should give me lowest highest.
how sort this?
thanks
from comment:
the first record of person gross wages. 2nd , on taxes paying gross wages.
why not add column type of transaction , use column in sort?
update - dedicated alex
to make answer more "answery", query like:
select * yourtable order firstname, lastname, if(transactiontype='grosswages', 0, 1), amount;
Comments
Post a Comment