Microsoft SQL Server では[行値構成子]は実装されていない (SQLServer 2008 Express)
SELECT TA.*
FROM TA
WHERE (key1,Key2,Key3)
(SELECT Key1,Key2, MAX(Key3) FROM TA WHERE .... GROUP BY Key1,Key2 )
とりあえず
SELECT TA.*
FROM TA
INNER JOIN
(SELECT Key1,Key2,MAX(Key3) as Key3 FROM TA WHERE .... GROUP BY Key1,Key2 ) AS TB
ON (TA.Key1=TB.Key1 AND TA.Key2=TB.Key2 AND TA.Key3=TB.Key3)
0 件のコメント:
コメントを投稿