Jan 29, 2011

Sqlserver HOW TO USE DISTINCT KEY WORD

The DISTINCT keyword eliminates duplicate rows from the result set of a SELECT statement. If DISTINCT is not specified, all rows are returned, Including duplicates.

Syntax :



SELECT  DISTINCT  <COLUMN_NAME>  FROM  <TABLE_NAME>

EXAMPLE :



SELECT  DISTINCT  AIRLINE_CODE  FROM  AIR_MASTER


It will be show only unique records in the result set .

No comments:

Post a Comment