mysql

Show all Duplicate value of a specific column in mysql


id name phone
1  google 5689
2  msn  63699
3  google 78972
4  yahoo  20144

I want to show the result like this

id name phone
1  google 5689
3  google 78972

Solution

  • select *
    from ax
    where name1 in (select name1 from ax group by name1 having count(name1)>1)