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

查看:16
本文介绍了在 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?

推荐答案

您应该利用 group by query.我写的一个旧博客是了解 group bys

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天全站免登陆