logging - MySql searching for shared values across different rows -
so looking possible solution problem not find anywhere. have log table logs users' visits (campaign name, ips, useragent string, hostname etc etc). i'm trying list of shared ips seen across campaigns define.
so, here table ex:
log ------------------------------------------------------------------- id ip campaignname username ------------------------------------------------------------------- 1 173.45.87.2 uk-test john 2 12.45.76.53 go-4 john 3 173.45.87.2 robo-s john 4 67.55.33.77 wrangles john 5 3.25.233.53 stan-die john 6 173.45.87.2 startma john 7 123.45.67.23 fresh.goal john 8 54.23.57.86 ert56 john 9 173.45.87.2 yuoit john
desired output should be: 173.45.87.2
as ip appears in username (john) campaigns.
forgot mention know username , campaigns, it's shared ips across campaigns i'm looking for.
thanks helpers
select ip log username = 'john' grouping ip having count(*) > 1
mysql logging shared
No comments:
Post a Comment