Mysql--自关联、子查询

mac2022-06-30  28

**自关联,表:省份、城市、县级区都有id、name共同属性,可以建立一张卡, id、name、pid ** 查询山东省有哪些城市

select province.name,city.name from areas as province inner join areas as city on city.pid=provice.id having provice.name='山东省';

子查询(速度慢点)

查询最高男生信息 select * from student where height=(select max(height) from student );

最新回复(0)