Mysql Distinct Statement

The DISTINCT keyword can be used to return only distinct values.

DISTINCT Syntax
SELECT DISTINCT column_name,column_name
FROM table_name;

Examples


Normal Select Staement.

select Code,Name from country
Result:
1    INDIA
2    INDIA
3    CHINA
4    LONDON

Distinct Select Statement

select distinct Code,Name from country

Distinct Result:


1    INDIA
3    CHINA
4    LONDON

Post a Comment

0 Comments