I have the following two tables. I am using SQL Server 2008 R2
Create table
Returns a result set
A 1 A 10 B 1 B 20 C 2 C 40 A 2 A 30
I would like to have the following result set
A 1 A 10 B 1 B 20 C 1 null null A 2 A 30 B 2 null null C 2 C 40
Right now I understand this by creating a new table with cross join like this and then doing an outer join
select * into
Is there a better way to do this?
thanks
sql sql-server tsql sql-server-2008-r2
Satfactor
source share