SQL WHERE ANY, ALL Clause
- ANY and ALL keywords are used with a WHERE or HAVING clause.
- ANY and ALL operate on sub-queries that return multiple values.
- ANY returns true if any of the sub-query values meet the condition.
- ALL returns true if all of the sub-query values meet the condition.
The SQL WHERE ANY and ALL syntax
The general ANY syntax is:- SELECT column-names FROM table-name WHERE column-name operator ANY(SELECT column-name FROM table-name WHERE condition)
The general ALL syntax is:
- SELECT column-names FROM table-name WHERE column-name operator ALL (SELECT column-name FROM table-name WHERE condition)
Comments
Post a Comment