SELECT
MYSCHEME.C.ID as CELLID,
MYSCHEME.C.NUM as CELLNUM,
MYSCHEME.C.UND_ID as U_ID,
MYSCHEME.U.SERIAL as SERIAL,
MYSCHEME.U.AMS_NETID as AMSID,
MYSCHEME.U.IP_ADDRESS as IP_ADDRESS,
MYSCHEME.U.MAC_ADDRESS as MAC_ADDRESS,
MYSCHEME.IDARESULTS.ID as IDAID
FROM
MYSCHEME.C
LEFT OUTER JOIN MYSCHEME.U ON MYSCHEME.C.U_ID = MYSCHEME.U.ID
LEFT OUTER JOIN MYSCHEME.IDARESULTS ON MYSCHEME.C.ID = MYSCHEME.IDARESULTS.CELLID
WHERE
MYSCHEME.C.SA = 1;
此处IDARESULTS
表格中包含ACTION_DATE
列TIMESTAMP
。
我需要修改上面的查询,因此LEFT OUTER JOIN MYSCHEME.IDARESULTS ON MYSCHEME.C.ID = MYSCHEME.IDARESULTS.CELLID
只返回1条记录,该记录具有最近的时间戳。我怎样才能实现它?