I need to select fields message and username from table list where list_id=1 (it can be 2 or 5 etc) with minimal number value (min(number)). How can i do it?
I tried it:
SELECT `message`,`username` FROM `list` WHERE `list_id`=2 AND min(`number`)
But it not work.
Try so
SELECT `message`,`username`
FROM `list`
WHERE `list_id` = 2
ORDER BY `number` ASC
LIMIT 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With