DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
SQL
IT Tags

Use of DISTINCT clause

By: rekha singh | 29 Apr 2010 11:14 am

Use of DISTINCT clause

 
In table, some of the columns may contain duplicate values. Sometimes you will want to list only the different (distinct) values in a table.
 
The DISTINCT clause allows removing duplicates from the result set. and this clause can only be used with select statement.
 
Syntax
 
SELECT DISTINCT ColumnName1,ColumnName2 FROM TableName;
 
OR
SELECT DISTINCT * FROM TableName;
 

EXAMPLE
SELECT DISTINCT * FROM Employee;
 
 
 
 
 

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move