Professional Documents
Culture Documents
ANY and ALL are two most –important operators which are used with WHERE and HAVING clause. If
any subquery values meet the condition, the ANY operator returns true. If all operators meet the
conditions of the subquery, the ALL operators return true.However a standard comparision operator (=, !
=, >, < ,>=, <=) should be used as an operator.
ANY Syntax:
SELECT column_name(s)
FROM table_name
WHERE column_name operator ANY
(SELECT column_name FROM table_name WHERE condition);
ALL Syntax:
SELECT column_name(s)
FROM table_name
WHERE column_name operator ALL
(SELECT column_name FROM table_name WHERE condition);
SELECT *
INTO newtable [IN externaldb]
FROM oldtable
WHERE condition;
To copy only some columns into a new table:
SELECT column1, column2, column3,...
INTO newtable [IN externaldb]
FROM oldtable
WHERE condition;