Sqlserver
 sql >> Base de données >  >> RDS >> Sqlserver

Requête SQL de jointure croisée

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