outerJoin on same table
I'm used to Oracle and find all this sql-server "outer join" syntax very confusing and unnecesary, but soit. I want to select all Months, together with only the Countries where customertype = 'Consumer'. Looks to me as a outer join, so I made this up ( made it a full outer join to make it more easy):
SELECT
a.Country, b.Month
FROM Data a FULL OUTER JOIN Data b
on a.GuideNr = b.GuideNr
where a.Customertype = 'Consumer'
It gives me only the Months and Countries where a.Customertype = 'Consumer', so I'm missing all other Months. Is sql-server capable of joins to the same table or am I missing something?
Many thanks!!!
|