我在加入时收到重复记录,我只想要 NSANOTES.NOTEDATE 上的 MAX(最新)日期。请问你是怎么做的?
SELECT NSAACTIVITY.NSAID ,
NSAACTIVITY.NSASERVICEIMPACTED "Type",
NSAACTIVITY.NSAAPPROVED,
NSAACTIVITY.NSADESCRIPTION,
NSANOTES.NSANOTE
FROM NSAUSER.NSAACTIVITY INNER JOIN NSAUSER.NSANOTES ON NSAACTIVITY.NSAID=NSANOTES.NSAID
WHERE TO_CHAR(NSAACTIVITY.NSASTART, 'yyyy-mm-dd hh24:mi') BETWEEN '2013-06-28 10:59:59' AND '2013-07-01 06:00:01'