create table College(cName varchar(100), state varchar(100), enrollment int);
insert into College values ('Stanford', 'CA', 15000);
insert into College values ('Berkeley', 'CA', 36000);
insert into College values ('MIT', 'MA', 10000);
insert into College values ('Cornell', 'NY', 21000);
select cName
from College S1
where enrollment <= any (select enrollment
from College S2
where S2.cName <> S1.cName)
select cName
from College S1
where enrollment < any (select enrollment
from College S2
where S2.cName <> S1.cName)
These 2 queries return the same thing and I don't understand why. The first query is also not returning Berkeley but isn't Berkeley <= Berkeley.
question from:
https://stackoverflow.com/questions/65910269/sql-any-any-returns-same-thing 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…