存在条件(EXISTS Conditions)用于测试子查询中是否存在指定的行。
语法
EXISTS (subquery)
如果子查询至少返回一行,则说明存在您想要的数据。
示例
SELECT department_id FROM departments d WHERE EXISTS (SELECT * FROM employees e
WHERE d.department_id = e.department_id) ORDER BY department_id;
作者:冒牌SEO,如若转载,请注明出处:https://www.web176.com/oceanbase/26228.html