我尝试在 SQL Server 2005 中使用以下代码(它是在 2012 年编写的):
SELECT *
FROM (SELECT TOP (100) PERCENT ID_BADGE,
DATE_TRX,
CODE_TRX,
SEQ_REC
FROM omi.DCUTRX_ZERO
UNION ALL
SELECT TOP (100) PERCENT ID_BADGE,
DATE_TRX,
CODE_TRX,
SEQ_REC
FROM omi.TAHIST_ZERO) OMI
WHERE ( ID_BADGE = ' ' + @Badge )
AND ( DATE_TRX BETWEEN @Date AND @Date2 )
AND ( SEQ_REC IN ( '0', '1000' ) )
AND ( CODE_TRX IN ( '100', '101' ) )
OFFSET 1 ROWS
FETCH NEXT 2 ROWS ONLY
谁能告诉我等效的 SQL Server 2005?