Top Menu

Search This Blog

SQL SELECT DISTINCT Command

The SELECT DISTINCT Command is used to return only different and unique values.

In a table and column may contain many duplicate values and you only want to list the different and unique values.

Syntax:


SELECT DISTINCT column_1_name,column_2_name,.... FROM table_name

As you see, we have like this "Candidate" table.













The following SQL syntax selects only the distinct values from the "FirstName" columns from the "Candidate" table

Example:

  SELECT DISTINCT FirstName  FROM CANDIDATE

Output:

Post a Comment

Designed by OddThemes | Distributed By Gooyaabi Templates