create table #temp (EMPID int,IN_TIME varchar(25),OUT_TIME varchar(25),IN_GATE
int,OUT_GATE int)
insert into #temp values (124,'01-12-2019 08:49:35 AM',NULL,4,NULL)
insert into #temp values (124,NULL,'01-12-2019 06:53:03 PM',NULL,5)
select empid, max(in_time) as in_time,max(out_time) as out_time,
max(in_gate) as in_gate,max(out_Gate) as out_Gate
from #temp
group by empid
drop table #temp