Say I have columns \'a\' and \'b\'. A record is deemed \'ready\' if !a || b. How can I sort by this ready condition? I\'m really rusty with SQL and I can\'t reca
!a || b
So you just want all rows where !a or b is true first? If so order by !a and then by b.
You can put expressions in the ORDER BY clause.
ORDER BY
ORDER BY (!a || b) ASC
order by case when !a || b then 0 else 1 end