Explore BrainMass
Share

Using OR, AND, ANY, and ALL with SQL queries

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

The OR and AND operators are used in compound conditions. Is there any relationship between these operators and the ALL and ANY operators? Outside references are required.

© BrainMass Inc. brainmass.com October 16, 2018, 7:59 am ad1c9bdddf - https://brainmass.com/computer-science/sql/using-or-any-all-sql-queries-277314

Solution Preview

The MySql operators OR and AND can be used in conditions in a query. For example:

SELECT * FROM mytable WHERE id > 100 AND age < 65;

This statement selects all the items from the table where the id is
greater than 100 AND the age is less than 65. Both conditions must be
met. Likewise, the following query uses the OR operator:

SELECT * FROM mytable ...

Solution Summary

This solution shows how to use OR, AND, ANY, and ALL in SQL queries. It also explains how they work.

$2.19