SQL INTERSECT - Overview, syntax

          

SQL INTERSECT - Overview, syntax


SQL INTERSECT - Introduction and syntax

<<Previous  Next>>

SQL - Dec 03, 2008 at 18:00 PM by Rajmeet Ghai

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

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.

Syntax:
Select field1, field2, . field_n from tables INTERSECT select field1, field2, . field_n from tables;

Example:
Select salary from employee INTERSECT select salary from manager;


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

WHERE: It is used to fetch records that fulfill a specified condition.................

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

TOP clause is used to specify the number of records to return. Usually used for large tables.................

SQL Server summarizing data

We have CUBE or ROLLUP operators to generate summary reports. Both are part of the GROUP BY clause of the SELECT statement.............

SQL MINUS

SQL MINUS returns all rows in the first query that are not returned in the second query..................

SQL LIKE

LIKE clause is used for pattern matching. % is used to match any string of any length where as _ allows you to match on a single character................

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

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