So i have database with a table called users.. and in that table there is a column named IP and i want to find users with the same IP and ban them.. So how can a search the
You should leverage the group by query. An old blog I wrote is Understanding group bys
But basically this should work:
select distinct ip, count(id) from users group by IP having count(id) > 1
This will return all ip addresses with a count of > 1