Re: [SQL ] 同一表格同一欄位資料統計

作者: qwertmn (抽筋)   2013-11-20 23:18:50
※ 引述《joedenkidd (優質的藍色射手)》之銘言:
: Dear 版友
: select sum(*) from table1 where finish =1; //找出完成的資料
: select sum(*) from table1 where finsih =0; //找出未完成的資料
: 想請問一下,要如何將上面兩個查尋合併成一個
select
count(if(finish=1, true, null)) as f1,
count(if(finish=0, true, null)) as f0;
這樣?

Links booklink

Contact Us: admin [ a t ] ucptt.com