我不能使用公用表表达式:
WITH cte
AS (SELECT [StationID],
[LastDistribution]
FROM [DB1].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB2].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB3].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB4].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB5].[dbo].[ProcessingStations]
ORDER BY [StationID]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB6].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB7].[dbo].[ProcessingStations]
UNION ALL
SELECT [StationID],
[LastDistribution]
FROM [DB8].[dbo].[ProcessingStations])
SELECT *
FROM cte
ORDER BY StationID
我该怎么做呢?