mysql if

select t.site_id,
if(id=24,num,0)a,
if(id=11,num,0)b
FROM

xx t

原文地址:https://www.cnblogs.com/zfzf1/p/10647927.html