Skip to content

How to create right query?

I’m trying write a query: SELECT id FROM users WHERE status = 3 But if this sample returns an empty response, then I need instead to select the id where status = 4, and if it returns empty again, …

SQL group by with condition

Imagine i have a table like below: ID Score someOtherColumns 1 1 …. 2 1 ….. 3 4 …. 5 2 …. 6 1 …. where score can have an intger …