Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Query SQL con join incrociato

SELECT        C2.name, C.Name AS Expr1, S.Name AS Expr2
FROM            City c 
LEFT OUTER  JOIN State s ON c.stateid = s.id
LEFT OUTER  JOIN Country c2 on s.countryId = c2.id