English 中文(简体)
MySQL 找到用户使用同一个IP地址的多种用户名的书证
原标题:MySQL Query that will find users using the same IP Address for multiple usernames

I ve done some homework on this issue and I am pretty sure it will involve joining a table with itself but I m not quite there yet.

我有一个“职位”表的论坛。 它为论坛上的每一个员额储存管道、用户名称、使用渠道和邮资。

我正试图得到一个问询,我可以每周或每星期开一次,这样,我就能够拿出一份清单,列出多个用户在此期间使用的管道和涉及多个用户使用同一地址的工厂。

I ve got this so far from other people s similar questions here:

SELECT t1.userid,t2.userid, t1.username, t2.username, t1.ipaddress, t2.ipaddress, t1.postid, t2.postid
FROM qvb_post t1
INNER JOIN qvb_post t2 ON t1.ipaddress=t2.ipaddress AND t1.userid!=t2.userid
WHERE 
t1.dateline > 1335897698 AND t2.dateline > 1335897698

但是,它退回了海事组织的许多不必要牢房,例如,它每重复两种方式,例如如果使用1台旧车,就使用2个排垫,而如果使用2台旧车,则再次重复使用1号车。

The dateline is from a few days ago.

理想的情况是,我只想看到一个Pip地址清单,以便有重复的用户名称和每个员额重复使用,因此,我可以与PHP一起,并提出报告,说明如何编制IP地址、使用该地址的用户名称(用户)以及他们创建的海报。

I am aware that there are many valid reasons two people will have the same ip address, rest assured no harsh action would be taken against anyone merely for showing up in this report.

事先感谢你能够提供的任何帮助。

简言之,用购买力平价计算,只有我需要帮助的才能。

最佳回答

这应当让你开始:

SELECT ipaddress, GROUP_CONCAT(DISTINCT username)
FROM qvb_post
GROUP BY ipaddress
HAVING COUNT(DISTINCT username) > 1
ORDER BY COUNT(DISTINCT username) DESC

该表显示了一个以上不同的用户名称所使用的IP地址,并给出了每个IP地址的用户名称的 com式清单。 如果你愿意的话,你还可以将职位识别包括在内。

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签