看板 Database 關於我們 聯絡資訊
我是初學者 我有幾個問題想要請教一下 問題一: 我已有的表(finish) 事件編號(ID) 完成者(human) ....................... 001 A 002 B 003 A 004 C 005 A . . . . 我想要找完成最多事情的人,我寫成(如下),可是會錯誤 with count_ID (name, value) as select human, count(ID) from finish group by human with max_ID (value) as select max(value) from count_ID select name from max_ID , count_ID where max_ID.value = count_ID.value 問題二: 已有表一(t1) 表二(t2) no no ...... ...... 25 29 27 32 29 35 32 35 48 我想要找t1中的no但不可以出現在t2 就是說我想要的答案是出來 25 27 48 (select no from t1) except (select no from t2) 我寫成這樣但還是會錯 不知道是不是還有什麼是要設定的嗎 而且我也不能用類似....in (select...這種語法 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.252.200
slalala:left join+ not null 06/08 04:13
vicgila:感謝樓上~~那問題一要怎麼做? 06/08 23:18