当我在那里运行下面的查询没有错误时,结果如何。请注意查询中的 DESC。
select date(created) date,
count(distinct some_id) subsccount,
type
from sometable
group by date,type DESC
limit 5
最佳答案
作为 select syntax 上的 MySQL 文档说:
MySQL extends the GROUP BY clause so that you can also specify ASC and DESC after columns named in the clause:
SELECT a, COUNT(b) FROM test_table GROUP BY a DESC;
关于mysql group by column1,column2 'Desc\|asc' 没有报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48946110/