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

看板Database作者 (抽筋)時間12年前 (2013/11/20 23:18), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/6 (看更多)
※ 引述《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; 這樣? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.67.110.73
文章代碼(AID): #1IZDBT5W (Database)
討論串 (同標題文章)
文章代碼(AID): #1IZDBT5W (Database)