如何將以下2個查詢合併到一個查詢中?SQL:在同一字段中使用不同where子句的2個不同計數
select count(distinct user_id) as action_1_count, date
from table
where action = "action_1"
group by date;
select count(distinct user_id) as action_2_count, date
from table
where action = "action_2"
group by date;
你想讓他們爲兩列或兩行? – 2012-08-15 17:58:30