Skip to main content
VeloDB Cloud 26.x·Apache Doris 4.x (≤ 4.0 supported)·"Since X.Y" tags refer to Doris versionsversion mapping →

Exists Operators

Description

The EXISTS condition is used to test for the existence of rows in a subquery.

Operator Introduction

OperatorFunctionExample
EXISTSReturns TRUE if the subquery returns at least one row of dataSELECT department_id FROM departments d WHERE EXISTS (SELECT * FROM employees e WHERE d.department_id = e.department_id) ORDER BY department_id;