ANY

SQL ANY Keyword

The ANY keyword in SQL is used to compare a value to any value in a subquery. It returns TRUE if at least one of the values returned by the subquery satisfies the condition.

Tutorials dojo strip

SQL ANY Syntax

SQL

SQL ANY Example with Prescriptions Table

This query selects medication names from the Prescriptions table where the dosage matches any dosage used in prescriptions with the instruction 'Take once daily at bedtime.'. This query returns all medications where the dosage equals any dosage found in prescriptions that include the given instruction.

SQL

Note: This query will not work in our playground because the ANY keyword is not supported in SQLite, which is the engine used by TechKubo.

SQL ANY Labs

Tutorials dojo strip