Hi I apologize if the answer for this is somewhere else. I looked around and I could not see a simple solution. I have a query that I would like to run. I don't care about the order of the union set, only that the inner queries return the correct data which is the "Largest Areas".
(SELECT TOP 5 * FROM [geo].[Areas] WHERE CountryID = @CountryID AND (TypeID = 'City')
ORDER BY [ShapeArea] DESC) as BiggestCities
UNION ALL
(SELECT TOP 5 * FROM [geo].[Areas] WHERE CountryID = @CountryID AND (TypeID = 'National park')
ORDER BY [ShapeArea] DESC) as BiggestParks
But T-sql won't let me have ORDER BY on the sub-queries, only on the whole Union... Help appreciated! I would really prefer not to have to create temporary tables or anything like that.