about 9 years ago
It is used for conjunction with the select statement to eliminate the all the duplicate record and fetch only the unique record.
There are many situation that we found duplicate data on the database and better to get unique ones.
ex
- +----+----------+-----+-----------+----------+
- | ID | NAME | AGE | ADDRESS | SALARY |
- +----+----------+-----+-----------+----------+
- | 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
- | 2 | Khilan | 25 | Delhi | 1500.00 |
- | 3 | kaushik | 23 | Kota | 2000.00 |
- | 4 | Chaitali | 25 | Mumbai | 6500.00 |
- | 5 | Hardik | 27 | Bhopal | 8500.00 |
- | 6 | Komal | 22 | MP | 4500.00 |
- | 7 | Muffy | 24 | Indore | 10000.00 |
- +----+----------+-----+-----------+----------+
+----+----------+-----+-----------+----------+ | ID | NAME | AGE | ADDRESS | SALARY | +----+----------+-----+-----------+----------+ | 1 | Ramesh | 32 | Ahmedabad | 2000.00 | | 2 | Khilan | 25 | Delhi | 1500.00 | | 3 | kaushik | 23 | Kota | 2000.00 | | 4 | Chaitali | 25 | Mumbai | 6500.00 | | 5 | Hardik | 27 | Bhopal | 8500.00 | | 6 | Komal | 22 | MP | 4500.00 | | 7 | Muffy | 24 | Indore | 10000.00 | +----+----------+-----+-----------+----------+
query
The result
the query with distinct keyword
The result
0 Comment(s)