How to use SOME Keyword in SQL
In this article I am going to explain how to use SOME keyword in SQL.
In this article I am going to explain how to use ALL Keyword in SQL. A select statement known as subquery if it is codded within another SQL statement. Subquery can return a single value or a result set. This result set may contain a single column or more than one column.
There are four way to create subquery in a SELECT statement.
- In WHERE Clause
- In HAVING Clause
- In FROM Clause
- In SELECT Clause
SOME Keyword in SQL is used to test that a comparison condition is true for one or more of values return by subquery. We use SOME keyword with comparison operators like >,<,>= and <= .
ANY and SOME are equivalent keyword. Keyword ANY and SOME provide same output.
from mcnvendors join mcninvoices
on mcnvendors.vendorid = mcninvoices.vendorid
where invoicetotal < SOME
( select invoicetotal