更新时间:2024-07-24 GMT+08:00

Subqueries

EXISTS

EXISTS谓词确定是否返回任意行:

SELECT name FROM nation WHERE EXISTS (SELECT * FROM region WHERE region.regionkey = nation.regionkey)

IN

确定子查询生成的任意值是否等于给定的表达式。IN的结果遵循null的标准规则。子查询必须只生成一列:

SELECT name FROM nation WHERE regionkey IN (SELECT regionkey FROM region)