我想获取2个coulmns数并将它们的总数作为新列。 我该怎么做?Mysql添加并将它们添加为新列
我写了这个查询,但是这总是返回错误。
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
你是怎么意思把'把他们全部当成新专栏? – Starx 2012-04-18 10:12:33
在HOT和Special_Case中获取的总人数为 – Thompson 2012-04-18 10:14:54
'当1 = 1然后1结束时总会返回一个.. – Starx 2012-04-18 10:15:42