SQL stands for Structured Query Language. It is used to store, manipulate, and retrieve data present in a database server. We use the DISTINCT keyword in SQL with a SELECT statement to remove the duplicate records and return unique records. In this article, we will explore and understand the DISTINCT keyword. 


The DISTINCT keyword in SQL is used to fetch unique records and eliminates the duplicate records in the table. 


SELECT DISTINCT column1, column2,.....columnN 

FROM table_name

WHERE [condition]

Become The Highest-Paid Business Analysis Expert

With Business Analyst Master's ProgramExplore Now
Become The Highest-Paid Business Analysis Expert


Consider the table titled CUSTOMERS” with the records below;


The following SQL statement selects only the DISTINCT values from the ‘city’ column:


This will produce the following result:


Let’s look at one more example:


This will produce the count of different cities in the ‘customers’ table.


You can also select multiple columns to get unique results from them.



Gain expertise in the latest Business analytics tools and techniques with the Post Graduate Program in Business Analysis. Enroll now!

Next Steps

Now that you know about the SQL DISTINCT keyword, it’s time for you to take the next step. This is an essential step to moving forward in your journey to becoming an SQL expert. If you found this article beneficial and want to get certified, check out Simplilearn’s Business Analyst Master’s Program. This comprehensive program covers SQL in-depth. Upon completion you can earn your certification in this field can jumpstart your career. 

Do you have any questions for us? Feel free to place them in the comments section of this article. We’ll get our subject experts to answer them for you ASAP.

About the Author

Aryan GuptaAryan Gupta

Aryan is a tech enthusiast who likes to stay updated about trending technologies of today. He is passionate about all things technology, a keen researcher, and writes to inspire. Aside from technology, he is an active football player and a keen enthusiast of the game.

View More
  • Disclaimer
  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.