add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE user_device (
id INT,
user_id int,
user_ip_address varchar(30) );

insert into user_device values
(1,1,'1.1.1.1'),
(2,1,'1.1.1.1'),
(3,2,'2.2.2.2'),
(4,3,'3.3.3.3'),
(5,1,'10.10.10.10'),
(6,4,'4.4.4.4'),
(7,2,'20.20.20.20'),
(8,3,'3.3.3.3');




Records: 8  Duplicates: 0  Warnings: 0
select user_id
from user_device
group by user_id
having count(distinct user_ip_address) >1;
user_id
1
2