Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

Join 2 tables with a reference table

$
0
0

I have two large tables that I am trying to join together by two columns. Below are the tables with two samples in each table, the reference table and also the final result that i want. Can anyone help me and any pointers. Thank you so much. 

Join on xAlias = mAlias 

Join on xValue =mValue

And if xValue =mValue is null then look at xRefValue = mRefValue

Result



Viewing all articles
Browse latest Browse all 12890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>