mysql count 搭配case的使用,一条sql统计多条数据
作者:互联网
SELECT
count(CASE WHEN testresult IS NULL THEN 1 end)'NULL',
count(CASE WHEN testresult ='FAIL' THEN 1 end)'FAIL',
count(CASE WHEN testresult = 'PASS' THEN 1 end)'PASS'
FROM auto_jdy_uidesc
WHERE Uitest_id IN
(SELECT a.id from auto_jdy_taskdesc a WHERE a.taskname ="login")
标签:count,case,end,testresult,PASS,WHEN,CASE,mysql 来源: https://blog.csdn.net/saberpan/article/details/102747006