Skip to content
Advertisement

Return all rows from one table, and match rows from another table

I have the following two tables:

ExchangeRate (T1):

Customer (T2):

I want a result as below:

I have tried this query

but, I got this result

I need the result like Cross Join. Kindly help me to resolve this issue.

Advertisement

Answer

Use a cross join with a case expression to determine whether to display the results or not.

Note: Don’t use nolock unless you absolutely must and are clear about the possible consequences.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement