How do we select distinct values from a table

DISTINCT keyword is used to return only distinct values.

Below is syntax:- Column age and Table pcdsEmp

SELECT DISTINCT age FROM pcdsEmp

To select distinct values from a table in a relational database management system (DBMS), you would typically use the SELECT DISTINCT statement. Here’s the general syntax:

sql
SELECT DISTINCT column1, column2, ...
FROM table_name;

This query will return only unique values from the specified columns in the table. If you want distinct values from all columns, you can simply use SELECT DISTINCT * FROM table_name;.