MySQL---子查询

select * from students where height = 188;

select * from students where height = (select max(height) from students);
将select语句里面还嵌入有select语句。

select * from students where pid = (select aid from areas where atitle=“河北省”);

SQL语句方法没有唯一答案,但是执行时间有区别。在数据量很大的时候。

子查询比较耗时,能不用则不用~

猜你喜欢

转载自blog.csdn.net/qq_40637313/article/details/88948863