举几个例子来说明ALL和ANY的用法

1. SELECT * FROM TABLEA WHERE FLD > ALL(SELECT FLD FROM TABLEA) 这相当于 SELECT * FROM TABLEA WHERE FLD > (SELECT MAX(FLD) FROM TABLEA)

2. SELECT * FROM TABLEA WHERE FLD > ANY(SELECT FLD FROM TABLEA) 这相当于 SELECT * FROM TABLEA WHERE FLD > (SELECT MIN(FLD) FROM TABLEA)

3. SELECT * FROM TABLEA WHERE FLD = ANY(SELECT FLD FROM TABLEA) 这相当于 SELECT * FROM TABLEA WHERE FLD IN (SELECT FLD FROM TABLEA)

04-23 06:54