Skip to content
Advertisement

Adding missing records from another columns in a different table

I have 2 tables :

Table A:

Table B :

I want the output table to contain all numbers and years from table B in Table A. So, the text qwe should be shown 12 times with respective numbers.

Output Table:

Note: Table A contains more values than qwe so i am trying to replicate 12 values for all of the different records. Column D should be showing 0 for records that dont exist.

I have tried a full outer join but a full outer join produces 12 records for each record of qwe in table A.

Advertisement

Answer

what about cross join

output

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