简体   繁体   English

ORDER BY最小数字

[英]ORDER BY lowest number

I am trying to order by lowest however this sql term below order's by highest number 我试图按最低顺序排序这个sql术语低于最高数量的顺序

SELECT * FROM questions ORDER BY question_ref DESC LIMIT 1;

Any help would be appreciated 任何帮助,将不胜感激

Make it ASC: SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1; 使其成为ASC: SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;

Or: SELECT MIN(question_ref) FROM questions; 或者: SELECT MIN(question_ref) FROM questions;

使用ASC而不是DESC

SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;
SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;

使用升序而不是降序排序应该可以SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;SELECT * FROM questions ORDER BY question_ref ASC LIMIT 1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM