Monday, February 8, 2010

SELECT DISTINCT - Introduction and syntax

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

SELECT DISTINCT: It is used to select unique records from a table. Some tables may have duplicate values for a column. Distinct will eliminate these duplications.

Syntax:

SELECT DISTINCT column_name(s) FROM table_name

Example:

SELECT DISTINCT mobile_num FROM Employees

No comments:

Post a Comment