mysql

How can I show all duplicate value from 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)