子查詢 子查詢是一種常用電腦語言SELECT SQL語言中嵌套查詢下層的程式模塊。當一個查詢是另一個查詢的條件時,稱之為子查詢。 表就不發出來了,將就著看叭,主要是表我找不到了是哪一個了。 ...
子查詢
子查詢是一種常用電腦語言SELECT-SQL語言中嵌套查詢下層的程式模塊。當一個查詢是另一個查詢的條件時,稱之為子查詢。
# 子查詢的用法
# 在欄位
select (select cName from courses where cNo = cID) as '課程名稱', count(elNo) from elogs GROUP BY cID;
# 在表
select * from courses where exists(
select * from (select sum(cCredit) as sumValue from courses where cNo in (
select cID from elogs where sID ='20180001' and elScore >=60
)
)as A where sumValue<10) ;
表就不發出來了,將就著看叭,主要是表我找不到了是哪一個了。