I want to return a single row but want one query to qualify the two conditions.
For example
SELECT * FROM user WHERE admin < 10 OR admin > 100 LIMIT 1
When I query this, will this return the first row it finds that has an admin value less than 10? If not, how would I achieve this?
Advertisement
Answer
You can do this using order by
. I would suggest:
SELECT * FROM user WHERE admin < 10 OR admin > 100 ORDER BY admin LIMIT 1