大家好:
小弟想詢問調三資料庫第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
--
小弟想詢問調三資料庫第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
--
All Comments