riggs riggs - 3 months ago 9
SQL Question

SQL Server query: pair each record from table 1 to all record at table 2

Guys I am having a hard time searching for this, I just can't properly write it in words.. but it's like this. attached image -->

MY PROBLEM

qxg qxg
Answer

You need a CROSS JOIN.

SELECT TABLE1.BAKESHOP_NO, TABLE2.PRODUCT_NO
FROM TABLE1 CROSS JOIN TABLE2
ORDER BY BAKESHOP_NO, PRODUCT_NO