我想使用降序对名为“bname”的列或名为“count”的列进行排序
我有这个未排序的代码:
SELECT bname FROM brandnames HAVING count(*) > 0 LIMIT 11
SELECT bname
FROM brandnames
HAVING count(*) > 0
ORDER BY bname DESC
LIMIT 11
ORDER BY bname DESC
将其附加到 SQL 语句的末尾。
ORDER BY
特定领域的订单。
DESC
指下降。这意味着反向字母或反向数字,或反向日期顺序。
取决于类型。删除DESC
它,它会自动升序。
祝你好运!
利用ORDER BY _column_ ASC/DESC
SELECT bname FROM brandnames HAVING count(*) > 0 ORDER BY bname DESC LIMIT 11