Pl find below Code
create table testi3 (empcode varchar(30), payroll_code varchar(30),pprdfrom int,pprdto int)
2. insert values
insert into testi3 values ('1','S0010',90,93)
insert into testi3 values ('1','S0009',93,94)
insert into testi3 values ('1','S0008',94,NULL)
insert into testi3 values ('2','S0008',94,NULL)
insert into testi3 values ('2','S0010',90,93)
insert into testi3 values ('3','S0010',90,93)
3. now if we execute below i get output (1,2)
select * from testi3
where pprdto is null
4. now if we execute below i get output (1,2,3) but i only need 3 since other 1,2 as Null in there previous rows,
select * from testi3
where pprdto is not null
so kindly help with a logic how get only 3