SQL MINUS - Introduction and syntax
SQL - Dec 03, 2008 at 18:00 PM by Rajmeet Ghai
Explain the SQL MINUS statement. Write SQL syntax for the SQL MINUS statement
along with an example.
SQL MINUS returns all rows in the first query that are not
returned in the second query. Each statement must have the same number of
fields in the result sets with similar data types.
Syntax:
Select field1, field2, . field_n from tables MINUS select field1,
field2, . field_n from tables;
Example:
Select salary from employee MINUS select salary from manager
SQL UNION: The UNION operator is used to combine the result-set of two or more
SELECT statements Tables of both the select statement................
SQL NOT NULL: The NOT NULL constraint enforces a column to NOT accept NULL
values..............
SQL INTERSECT allows combining results of two or more select queries. If a
record exists in one query and not in the other, it will be omitted from the
INTERSECT results..............
GROUP BY: It is used with aggregate functions to group the result-set by one or
more columns................
SQL CREATE VIEW: A view is a virtual table. A view contains rows and columns,
just like a real table..............
|