Subqueries
EXISTS
The EXISTS predicate determines whether to return any row.
SELECT name FROM nation WHERE EXISTS (SELECT * FROM region WHERE region.regionkey = nation.regionkey)
IN
It determines whether any value generated by a subquery is equal to a given expression. The IN result complies with the standard null rule. Only one column must be generated for a subquery.
SELECT name FROM nation WHERE regionkey IN (SELECT regionkey FROM region)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.