I have two temporary tables #a and #b filled with integer values. Let them say that both of them contain 10 lines with values โโof 1-10.
I want to create a third temporary table #c, which contains all possible combinations of a and b. Thus, it will have only 100 lines with (1,1), (1,2) ... (10, 10). How I will do it in SQL. The implementation I'm using is SQL Server 2012.
source share