This query returns no records, can someone help me rectify what I'm doing wrong? I want the inner table to fetch only one row, (i.e. I want the left table to first orderby ID DESC and then LIMIT 1, fetch the first result in ascending order).
$query = "select fsp_issue_log.ISSUE_SERIAL_NUM , fsp_issue_log.STATUS, fsp_issue_log.DATECREATED, fsp_issue_log.ASSIGNEDTO, fsp_issue_log.ORG
, fsp_issue_log.SEVERITY
, fsp_issue_log.DESCRIPTION
, fsp_ticket_hist.COMMENTS
FROM fsp_issue_log
JOIN
( SELECT COMMENTS
FROM fsp_ticket_hist
ORDER
BY ID DESC
LIMIT 1
)
ON fsp_issue_log.ISSUE_SERIAL_NUM = fsp_ticket_hist.TICKET_SN
";