What is the DISTINCT statement and how do use it
Loading
What is the DISTINCT statement and how do use it
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mukesh SagarPosted Aug 3, 2025, 5:48 AM
DISTINCT keyword is used to get the unique values from a database table. The syntax for the same is :
Select distinct deptno from emp;
Using this statement we get the unique department numbers avialable.
Jignesh KumarPosted Aug 5, 2025, 3:45 AM
Hi Kiran,
The
DISTINCTstatement in SQL is used to retrieve only unique values from a query, filtering out any duplicate entries. It is typically used with theSELECTstatement to ensure that the result set contains only distinct rows.Cynthia SathuragiriPosted Aug 4, 2025, 5:52 AM
DISTINCTgives you only unique values, removing any duplicates.DISTINCThelps you get only one entry for each unique combination of selected columns.SELECT DISTINCT column1, column2, ...
FROM table_name