有一个名为联系人的表,其中包含列id,名称,地址,ph_no等.
我需要查找具有相同名称的行,如果行数大于1,则显示这些行.
例如:
表:联系人
id--------name--------address---------ph_no--------
111 apple U.K 99*******
112 banana U.S 99*******
123 grape INDIA 99*******
143 orange S.AFRICA 99*******
152 grape KENYA 99*******
对于上面的表,我需要获得具有相同列名数据的行,如下所示:
id--------name--------address---------ph_no--------
123 grape INDIA 99*******
152 grape KENYA 99*******
我需要根据我给出的名称来获取行,如下面的示例语法:
select * from contacts where name='grape' and it's count(*) >1 return those rows.
如何实现上述问题的解决方案.