[問題] 102年調三資料庫考古題

看板 Examination
作者 chao0210 (半糖多多綠)
時間 2015-06-22 17:14:17
留言 2則留言 (1推 0噓 1→)

大家好: 小弟想詢問調三資料庫第5題之(一) 此小題說要用兩層式巢狀來解 太久沒coding了 不知道這樣寫是否符合"兩層式"巢狀 我自己解法感覺像又不大像 = = 題目不好排版故用圖床,解答在題目下方 先謝謝各位高手了 題目: http://i.imgur.com/p8xBzHE.jpg
解: select name , age , department from personal where department in( select department from personal where salary > 40000 group by department having count(employeeid)>=2 ) group by name , age ,department, salary having salary > 45000 --
※ 批踢踢實業坊(ptt.cc), 來自: 101.3.41.172
※ 文章網址: https://www.ptt.cc/bbs/Examination/M.1434964459.A.6FA.html

malowda: 用別名比較好外層不用group和having 06/22 23:02

ko74652: 最後兩行改成 and salary >4500就可了 06/23 00:40

您可能感興趣