GOOGLE幫你啦~
hitomitanaka 的語法 for mysql 是正確的; 另一語法 select name,sum(case WHEN cond=0 then col1...
花錢請人家幫你寫吧...