开发者

ORDER BY lowest number

开发者 https://www.devze.com 2023-03-04 21:34 出处:网络
I am trying to order by lowest however this sql term below order\'s by highest number SELECT * FROM questions ORDER BY question_ref DESC LIMIT 1;

I am trying to order by lowest however this sql term below order's by highest number

SELECT * FROM questions ORDER BY question_ref DESC LIMIT 1;

Any help would be appreci开发者_StackOverflow社区ated


Make it ASC: SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;

Or: SELECT MIN(question_ref) FROM questions;


Use ASC instead of DESC:

SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;


SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;


Using ascending rather than descending ordering should do the trick: SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;

0

精彩评论

暂无评论...
验证码 换一张
取 消