sql查詢——子查詢


1 -- 子查詢
2       -- 一句查詢語句內,再套一句查詢語句 ,叫子查詢
3       -- 查詢班級類身高最高的人的名字
4       select name from students where high=(select max(high) from students);
5       select id as "序號", name as "姓名",high as "身高" from students where high=(select max(high) from students) order by id desc;
6       -- 查詢省份下的所有區市,不知道省份的id
7       select name from china pid=(select id from china where name="四川省");

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM