SQL TUTORIALS-
SQL SELECT Query-Statement
Introduction-
SQL SELECT DISTINCT Statement Clause-
SELECT DISTINCT clause is used to return only unique (different) values from a specified column or set of columns in a table... Follow this Statement Here's a basic overview...
✅Why Use DISTINCT?-
✅When you query a table, the result might include duplicate rows.
✅Using DISTINCT filters out duplicate rows so each row returned is unique.
✅ Basic Example:-
SELECT DISTINCT column1, column2, ...
FROM table_name;
✅column1, column2, ... — Columns from which you want unique combinations of values.
✅table_name — The table you are querying.
✅Result Show :-
EmployeeID | Department |
---|---|
1 | IT |
2 | HR |
3 | Sales |
4 | Production |