SELECT *
FROM members m
JOIN (SELECT *
FROM members
WHERE logins_by_ip > 1
GROUP BY ip_address
HAVING COUNT(1) > 1) AS sel ON m.member_id = sel.member_id
ORDER BY m.ip_address
SUBSTRING_INDEX(ip_address, '.', 2)
SUBSTRING_INDEX(ip_address, '.', 3)