The EXISTS clause evaluates to TRUE if the specified subquery returns one or more rows, causing the outer SQL statement to execute.
Syntax
SELECT...FROM...WHERE EXISTS (subquery)
Parameters
|
Parameter |
Description |
|
subquery |
The |
Example
The following statement retrieves consumer group information when the read/write latency in a Logstore exceeds 1000.
-
Query and analysis statement
* | SELECT consumer_group FROM "internal-diagnostic_log" WHERE EXISTS ( SELECT Latency FROM internal-operation_log WHERE "internal-diagnostic_log".LogStore = "internal-operation_log".Logstore and latency >1000 ) -
The
query and analysis resultcontains the consumer_group column. An example value issls-ml-ag****ea76a483d4(partially masked).