sql any all

teacher表

select t.t_no,t.t_name,t.t_age
from teacher t
where t.t_age > any (select t_age from teacher where t_age>29);

>any的意思是大于任意一条即可,所以结果等价于   >30,即只有59的符合条件

select t.t_no,t.t_name,t.t_age
from teacher t
where t.t_age < all (select t_age from teacher where t_age>29);

<all 的意思是,小于所有的,即小于里边最小的那个,即<30

原文地址:https://www.cnblogs.com/adamgq/p/14321826.html