Wednesday, March 17, 2010

DISTINCT clause

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

See Status of the blog

site provides a good fundamental knowledge of sql and provide code help to create connection to your site and sql

1 comment:

Anonymous said...

learned a lot