开发者

MySql query to check for duplicate ips

开发者 https://www.devze.com 2023-02-02 15:50 出处:网络
I need to know if there\'s any method to do the task below using only a mysql query. I want to check if 2 accounts have on the last_login_from columm the same IP adress. I want the query to return all

I need to know if there's any method to do the task below using only a mysql query. I want to check if 2 accounts have on the last_login_from columm the same IP adress. I want the query to return all the rows that don't have an unique value on the last_login开发者_开发问答_from columm


select * 
from accounts a
where a.last_login_from IN 
    ( select last_login_from 
      from accounts
      group by last_login_from
      having count(*)>1 )
0

精彩评论

暂无评论...
验证码 换一张
取 消