WITH cte(RName, CName, RowNum) AS (SELECT R.Name AS RName, C.Name AS CName, ROW_NUMBER() OVER(PARTITION BY R.RegionId ORDER BY CID DESC) AS [RowNum] FROM Regions R INNER JOIN Countries C ON C.RegionId = R.RegionID ) SELECT * from cte where RowNum = 1
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.