我想获取 2 列计数并将它们的总数作为一个新列。我怎样才能做到这一点?
我写了这个查询,但这返回了错误的总数。
SELECT count(case when `status`='1' then 1 else 0 end) AS HOT,
count(case when `status`='5' then 1 end)
AS Special_Case,count(case when 1=1 then 1 end) AS TOTAL
FROM `tbl_customer_conversation` group by
date(`dt_added`),user_id