SQL Shorts - SELECT DISTINCT Statement (Learn new SQL Concepts in 5 minutes)

  • The SELECT DISTINCT statement is used to only return distinct or unique values in a particular selected column.
 Syntax:

SELECT DISTINCT column_name

FROM table_name

Examples:

Q). Find distinct names of people from the city Onionpur

Here, the query can be as follows:

SELECT DISTINCT names

FROM Onionpur

Q) Select distinct names from the table: students

Here, our query can be as follows:

SELECT DISTINCT name

FROM students

Points to remember:

  • DISTINCT is used to select unique values in a column.


 

Comments

Popular posts from this blog

How to clear the Alteryx Designer Core Certification Exam in Two Weeks

Current Affairs - 15 April 2021 - Current Affairs for General Knowledge and also to prepare for competitive exams

Current Affairs - 12 June 2021 - Daily Current Affairs for general knowledge and to prepare for competitive exams