select
g.Custid,
g.Grno,
g.Name,
case when c.Chno = 123 then c.Chno else null end Chno,
case when c.Chno = 123 then c.Chdate else null end Chdate
from
GrfileB g
join Challan c on g.Grno = c.Grno
where
g.Custid = 1
order by
g.Grno
Reputation Points: 262
Solved Threads: 68
Veteran Poster
Offline 1,181 posts
since Feb 2005