clear markdown compare help best fiddles feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3601472 fiddles created (47959 in the last week).

create table sample(id int, From_ varchar(20),To_ varchar(20));
 hidden batch(es)


insert into sample values(1,null,null); insert into sample values(1,null,null); insert into sample values(1,'2019-01-01','2019-01-01'); insert into sample values(2,null,null); insert into sample values(2,null,null); insert into sample values(3,null,null); insert into sample values(1,'2019-02-01','2019-02-01');
7 rows affected
 hidden batch(es)


select id from sample group by id having max(From_) is null and max(To_) is null;
id
2
3
Warning: Null value is eliminated by an aggregate or other SET operation.
 hidden batch(es)