Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何订购 DESC,然后使所有结果水平显示而不是垂直显示。
$sql = "SELECT name WHERE id > 5 ORDER BY id DESC";
您可以使用以下命令将所有名称放在逗号分隔的列表中group_concat():
group_concat()
select group_concat(name order by id) as names from t where id > 5
然后,您可以从列表中拆分出每个名称。(并且,如果逗号不是正确的分隔符,您可以使用separator关键字。)
separator