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