我试图只返回下表的一条记录但不工作。它返回多个记录。请告知,谢谢
我怀疑 groupby 的问题
CreateDate Firstname EventID
2013-05-13 18:11:35.187 Jack 0CD7B08A-0EAF-4515-9DE1-00FC6DB29A61
2013-05-13 18:11:35.310 Paul 16A584D5-E9B7-4617-8DC9-089C628E0ED5
2013-05-13 20:14:33.863 Craig AAA21035-1377-443D-9BEE-0C0761534803
这是上面结果的sql查询:
SELECT MAX (CreateDate) AS Create_Date, Firstname ,EventID
FROM SessionsEvents
WHERE TRN='0391588'
GROUP BY Firstname , TRN, EventID