create table stud(id int, grade varchar(20));
insert into stud values(1, 'A');
insert into stud values(2, 'A');
insert into stud values(3, 'B');
insert into stud values(4, 'B');
// Working of ALL : >=ALL, =ALL, >ALL : All the combinations Returning all rows
Select id from stud s WHERE s.grade =ALL (Select grade from stud e WHERE
e.id = 5);
// Working of ANY : >ANY, =ANY, >=ANY : All the combinations Returning no rows
Select id from stud s WHERE s.grade >ANY (Select grade from stud e WHERE e.id = 5);
Why is ANY and ALL behaving differently? Following are the queries -
I think the inner subquery rerturns NOTHING and NOT a null. Is that an empty set?
How is ANY and ALL deciding their output with respect to empty set?