mysql查詢(xún)關(guān)聯(lián)表,mysql的關(guān)聯(lián)查詢(xún)求和?
參考sql語(yǔ)句
select
sum(casewhena1=1then1else0end)asa1count,
sum(casewhena2=1then1else0end)asa2count,
sum(casewhena3=1then1else0end)asa3count,
sum(casewhena4=1then1else0end)asa4count
from表
參考sql語(yǔ)句
select
sum(casewhena1=1then1else0end)asa1count,
sum(casewhena2=1then1else0end)asa2count,
sum(casewhena3=1then1else0end)asa3count,
sum(casewhena4=1then1else0end)asa4count
from表