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