I don't completely understand your question, do you want only the rows where sku_key
is not null and present in both tbl_magazine_issue
and tbl_magazine_subscription_dtl
? In that case, you should do an inner join instead of a left outer join on tbl_magazine_issue
, and add a AND tu.sku_key IS NOT NULL
to the WHERE
clause. The query engine should be smart enough to apply this condition before the join.
You should also make sure that sku_key
and PurchaseKey
are indexed if you're concerned about performance of this join.