我的问题是:
SELECT location_description as Crimes,COUNT(*)
FROM test_sample
where test_sample.day_of_week LIKE"%sunday"
GROUP BY test_sample.location_description
UNION ALL
SELECT location_description as Crimes,COUNT(*)
FROM test_sample
where test_sample.day_of_week LIKE"%saturday"
GROUP BY test_sample.location_description
我的输出是:
如何将这两个重复值合并为一个。
2条答案
按热度按时间cgyqldqp1#
如果只需要通过“location\u description”字段获取记录数,则只能使用不带并集的分组
kmbjn2e32#
不用了
UNION
现在,只要调整一下WHERE
包括两天;