子查询
一个查询的结果做为另一个查询的条件。
查询
select * from tbl_students
where age = (select max(age)
from tbl_students );
最大学生的信息
查询黑龙江省的所有市
select * from areas where parent_id = (select id from areas where name = '黑龙江省');
#yyds干货盘点# 21 MySQL 子查询
阅读 32
2022-03-17
select * from tbl_students
where age = (select max(age)
from tbl_students );
select * from areas where parent_id = (select id from areas where name = '黑龙江省');
相关推荐
精彩评论(0)