i'm trying to conver my SQL to SAS but it gives me error in OUTER APPLY AND SELECT TOP 1 PROC SQL;
SELECT a.'PlayerID'n, c.'GamingDate'n
FROM (SELECT t1.'PlayerPatron ID'n FROM XXX.Player t1 GROUP BY t1.'PlayerID'n) a
OUTER APPLY
(SELECT TOP 1 * FROM
(SELECT t2.'PlayerID'n, t2.'GamingDate'n FROM XXX.FirsRating t2
UNION
SELECT t3.'PlayerID'n, t3.'Gamingdate'n FROM XXX.SecondRating t3) b
WHERE a.'PlayerID'n = b.'PlayerID'n ORDER BY b.'PlayerID'n DESC, b.'GamingDate'n DESC) c
WHERE GamingDate IS NOT NULL;
QUIT;
... View more