搜索PHPMYADMIN数据库中类似的条目 [英] Search PHPMYADMIN Database for similar entrys

查看:102
本文介绍了搜索PHPMYADMIN数据库中类似的条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个表名为users的数据库..在该表中有一个名为IP的列,我想找到具有相同的IP的用户和禁止他们..所以如何可以搜索IP的日期基础是同样?

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 datebase for IP's are the same?

推荐答案

您应该通过查询来利用组。我写的一个旧博客是了解小组

You should leverage the group by query. An old blog I wrote is Understanding group bys

但基本上这应该工作:

select distinct ip, count(id) from users group by IP having count(id) > 1

这将返回计数大于1的所有IP地址

This will return all ip addresses with a count of > 1

这篇关于搜索PHPMYADMIN数据库中类似的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆