select shopID from shop where ShopName in( select ShopName from shop group by ShopName having count(*)>1 )
通过这种方法获得shopName重复的行数。