討論串[SQL ] 同一表格同一欄位資料統計
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者rockchangnew (rock)時間12年前 (2013/11/22 00:16), 編輯資訊
0
0
0
內容預覽:
select class as 品名,. count(case when finish <>'' then '1' else null end) as 完成,. count(case when finish ='' then '1' else null end) as 未完成,. from tabl

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者cutekid (可愛小孩子)時間12年前 (2013/11/21 11:40), 編輯資訊
0
0
1
內容預覽:
select coalesce(t1.class,t2.class), coalesce(t1.cnt,0), coalesce(t2.cnt,0). from (. select class, count(*) as cnt. from table. where finish != ''. gro
(還有130個字)

推噓0(0推 0噓 1→)留言1則,0人參與, 最新作者joedenkidd (優質的藍色射手)時間12年前 (2013/11/21 09:28), 編輯資訊
0
0
0
內容預覽:
cutekid大大的方法,可以用,但因為我敘述不清,所以不適用,歹勢. select finish,sum(*) from yield_process where finish=0 or finish=1 group by finish. qwertmn大大的方法我試了,無法執行,不知是因為pgsq
(還有250個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者qwertmn (抽筋)時間12年前 (2013/11/20 23:18), 編輯資訊
0
0
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.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者cutekid (可愛小孩子)時間12年前 (2013/11/20 17:50), 編輯資訊
0
0
0
內容預覽:
select finish,sum(*). from table1. where finish = 1 or finish = 0. group by finish. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 118.170.31.124.
首頁
上一頁
1
2
下一頁
尾頁