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.
我必须选择前 5 条记录并按输入日期升序显示它们。
以下是我的查询:
select id,name,entry_date from users order by entry_date desc limit 0,5
它给了我最新输入的 5 个用户。但我希望它们按入境日期递增。
如何使用相同的查询按升序排列它们?
这将按需要工作
SELECT * FROM ( select id,name,entry_date from users order by entry_date desc limit 0,5 ) as a ORDER BY a.entry_date asc