Home » SQL Basics » Retrieving Data » Using Distinct

Using Distinct

Using Distinct:

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

Example: 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. Required fields are marked *