SQL Distinct


Prev Tutorial Next Tutorial

SQL Distinct

Select Distinct statement is used to retrieve only distinct or unique data. Select Distinct command is used with Select keyword.

Note: SQL Select Unique and SQL Select Distinct statements both are same.

Syntax

	
SELECT DISTINCT column_name, column_name
FROM table_name;

Employee table

emp_idnamesalary
101Amit24000
102Rahul34000
103Hitesh24000
104Gaurav26000
105Hitesh35000

Example

SELECT DISTINCT name
FROM Employee;

Result after Execute above query.

name
Amit
Rahul
Gaurav
Hitesh

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements