The DISTINCT keyword is used to retrieve the unique records by eliminating the all duplicate records.
Syntax:
SELECT DISTINCT column1, column2,.....columnN FROM tableName WHERE [condition]
Example:
SELECT DISTINCT EMP_NAME FROM EMPLOYEE;
Output:
EMP_NAME
Nidhi
Parbhjot
Parmender
One reply on “Distinct Keyword in SQL”
SQL Tutorials - Scaz January 26, 2023 at 5:14 pm
[…] SQL DISTINCT keyword […]