Help??? Why my code is not right?

  • 0

    select id, name, if(sex='f','m','f') as sex, salary
    from salary

    I refer the answer for 626. Exchange Seats, which is correct :

    if(id < (select count(*) from seat), if(id mod 2=0, id-1, id+1), if(id mod 2=0, id-1, id)) as id, student
    from seat
    order by id asc;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.