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

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -