Home » SQL Basics » Retrieving Data » Using Distinct

Using Distinct

Using Distinct:

SELECT DISTINCT “column_name1”, “column_name2″,….”column_nameZ” FROM “table_name”

SELECT DISTINCT name, age FROM employee

The distinct values are only displayed in name column of table. If there are two records for John exist in employee table then only one will be displayed omitting duplicates.

Leave a Reply

Your email address will not be published.