SQL MINUS - Overview, syntax

          

SQL MINUS - Overview, syntax


SQL MINUS - Introduction and syntax

<<Previous  Next>>

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


Explain the SQL UNION statement. Write SQL syntax for the SQL UNION statement along with an example.

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

SQL NOT NULL: The NOT NULL constraint enforces a column to NOT accept NULL values..............

SQL INTERSECT

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..............

SQL GROUP BY

GROUP BY: It is used with aggregate functions to group the result-set by one or more columns................

SQL CREATE VIEW

SQL CREATE VIEW: A view is a virtual table. A view contains rows and columns, just like a real table..............

<<Previous  Next>>



Write your comment - Share Knowledge and Experience


 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring