Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

idk if this is what the parent had in mind, but this seems straightforward enough:

    update t
    set user_order =
        case
        when id = 123
        then 500
        else user_order + 1
        end
    where id = 123 or user_order >= 500;


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: