[SQL ] oracle分組條件統計
資料庫為 oracle
假設table內容如下
A B C D E 欄位(其值如下)
-----------
A 1 0 1 0
A 2 0 2 0
B 1 1 1 1
B 2 0 2 0
C 1 1 1 1
C 1 1 1 1
我想求出此結果
A 2 =>(C和E欄位等於0的共有2個)
B 1 =>(C和E欄位等於0的共有1個)
C 0 =>(C和E欄位等於0的共有0個)
我該怎麼寫呢? 謝謝了~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 42.79.218.14
→
02/18 22:18, , 1F
02/18 22:18, 1F
→
02/18 22:18, , 2F
02/18 22:18, 2F
→
02/18 22:19, , 3F
02/18 22:19, 3F
→
02/18 22:35, , 4F
02/18 22:35, 4F
→
02/18 22:36, , 5F
02/18 22:36, 5F
→
02/18 22:36, , 6F
02/18 22:36, 6F
→
02/18 22:50, , 7F
02/18 22:50, 7F
→
02/18 23:08, , 8F
02/18 23:08, 8F
推
02/19 00:49, , 9F
02/19 00:49, 9F
→
02/19 09:18, , 10F
02/19 09:18, 10F
→
02/19 09:20, , 11F
02/19 09:20, 11F
→
02/19 09:20, , 12F
02/19 09:20, 12F
→
02/19 09:21, , 13F
02/19 09:21, 13F
→
02/19 09:22, , 14F
02/19 09:22, 14F
→
02/19 09:22, , 15F
02/19 09:22, 15F
→
02/19 09:23, , 16F
02/19 09:23, 16F
→
02/19 09:24, , 17F
02/19 09:24, 17F
→
02/19 09:25, , 18F
02/19 09:25, 18F
→
02/19 10:11, , 19F
02/19 10:11, 19F
→
02/19 10:17, , 20F
02/19 10:17, 20F
→
02/19 10:17, , 21F
02/19 10:17, 21F
→
02/19 10:19, , 22F
02/19 10:19, 22F
→
02/19 10:19, , 23F
02/19 10:19, 23F
→
02/19 10:29, , 24F
02/19 10:29, 24F
→
02/19 10:30, , 25F
02/19 10:30, 25F
→
02/19 10:31, , 26F
02/19 10:31, 26F
→
02/19 10:33, , 27F
02/19 10:33, 27F
→
02/19 11:47, , 28F
02/19 11:47, 28F
推
02/19 15:21, , 29F
02/19 15:21, 29F
→
02/19 15:21, , 30F
02/19 15:21, 30F
→
02/19 15:21, , 31F
02/19 15:21, 31F
→
02/19 16:18, , 32F
02/19 16:18, 32F
→
02/19 16:21, , 33F
02/19 16:21, 33F
→
02/19 16:22, , 34F
02/19 16:22, 34F
Database 近期熱門文章
PTT數位生活區 即時熱門文章
104
216