Why and how to use SQL DISTINCT Clause?
Ask by Abhishek Srivasatava
Updated 14 Sep 2020
Distinct is used when unique result is needed from user side. It is used because after joining many tables there is chance of multiple rows for single data may come.
For example
Prsn table holding the Adhar number of person.
And we join this prsn table with prsn_buy_prod table. Let person buy 3 product so three rows will exist.
Program without distinct:
But if use distinct along with select statement in the above program then single record will come.