This one ???
Code:
with t1(id,name) as
(
values(0,'ABC'),
(1,'XXX'),
(2,'ADO'),
(3,'ZZZ'),
(4,'ddd'),
(5,'xxxx'),
(6,'test')
),
t2(id,amt) as
(
values(0,50000),(1,0),(2,0),(3,10000),(4,0)
)
select a.* , b.* from t1 as a
LEFT OUTER JOIN t2 as b on
a.id = b.id
where amt<=0 or amt is null