Home >> MySql >> Any in MySql

Any in MySql

ANY is used with three operator-

1)-< ANY-It means less than the max value in the list.

2)-= ANY-It means equal to any value in the list(similar to IN operator).

3)-> ANY-It means greater than the minimum value in the list.

Syntax

SELECT columnname FROM tablename WHERE columnname operator ANY (SELECT column_name FROM table_name WHERE condition);

Example

SELECT product_name FROM products WHERE product_id = ANY (SELECT product_id FROM orders WHERE quantity= 8);

Post Your Comment

Next Questions
All
Max
Min
Avg
Count
Sum
How to see full query from SHOW PROCESSLIST
How do you display the whole query
How To Find Highest Salary
How To Find Second Highest Salary
How To Find Nth Highest salary
How to calculate number of days between two dates
Calculate days between two dates
How to Find the Number of Days Between Two Dates
How to Find the Number of Days Between Current Date to Specific Date
How much query taking long time to execute
How to Identify Performance Issues with Slow Queries
Using results from one query to use in another query
Using Output from one Query in a different Query
How to update a column with another column value from same table
How to update a column with another tables columns value
Updating one table row from another table row
Update columns values with column of another table based on condition
How to insert data in one table from another table
How to copy data from one table to another table

Copyright ©2022 coderraj.com. All Rights Reserved.