Link to home
Start Free TrialLog in
Avatar of MrTV
MrTVFlag for Thailand

asked on

mysql sww the duplicate on colum1 colum2 colum3

How can I cout the duplicate on colum1 and colum2 and colum3

I want the same address that duplicate

Hno  road  destrict     if 3 colums  is the same it mean it the same place
ASKER CERTIFIED SOLUTION
Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cyberkiwi
List all duplicates

select t.*, x.cnt
from tbl t inner join (
select hno, road, district
from tbl
group by hno, road, district
having count(*) > 1
) AS x on x.hno=t.hno and x.road=t.road and x.district=t.district
order by t.hno, t.road, t.district
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial