Distinct clause with select command display the Unique values of the specified column from SQL database table. Distinct means different, so when we use distinct keyword with an column name in Select command it means its display the non identical record form that column.
For example if we have a table "paid-Info" with following record:
Member_ID |
Paid Amount |
101 |
500 |
102 |
300 |
103 |
450 |
104 |
200 |
101 |
500 |
102 |
600 |
102 |
400 |
104 |
500 |
In this above table different user paid us some amount, but if we want to know how many user paid us then we use Distinct keyword with select command as below:
SELECT DISTINCT Member_ID FROM Paid-Info;
where
Memebr_ID is column name
Paid_Info is table name
Above command Display the following records:
Member_ID |
101 |
102 |
103 |
104 |
Select Command
Distinct clause with Select Command
Where clause In SQL
Logical Operator in SQL SELECT Statement
IN Operator in SQL
BETWEEN Operator in SQL
Use of Wildcards in SQL
LIKE Operator in SQL
ORDER BY Clause in SQL
GROUP BY Clause in SQL
HAVING Clause in SQL
ALIAS In SQL
AS Keyword In SQL
INSERT INTO Command In SQL
Inserting Record In to a Table Form an other Table In SQL
UPDATE Command in SQL
DELETE Command in SQL
AVG Function in SQL