Free Source Code and Tutorials

Custom Search

SQL Distinct Keyword


The distinct keyword is mainly  used with the Select statement  in order to get  unique values from the desired table. Distinct removes all the redundant records while retrieving from the database.


Syntax for DISTINCT Keyword

  1. SELECT distinct column-name from table-name;



Consider the following consumer table.

  1. select distinct salary from consumer;
Consumer id name age salary
10 rajat 20 90000
11 karan 45 85000
12 ram 37 67000
21 Shyam 41 85000
23 jon 33 90000


The above query will return only the unique salary from consumer table

Facebook Comments
(Visited 2 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: