Try the below:
select B.* from table B left join table A on B.Col3B = A.Col1 where A.IsActive = 1 Or A.ISActive is null
However, please provide indexes on the tables and the execution plan for the query to suggest more on the same.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
No comments:
Post a Comment