我正在执行以下查询并收到错误“子查询返回超过 1 行”
我的查询是
SELECT pkTicketID,
TicketReplyDateAdded,
TIMESTAMPDIFF(DAY, TicketReplyDateAdded, now()) as NumberOfDays
FROM tickets as T
LEFT JOIN ticket_replies as TR ON T.fkTicketReplyID=TR.pkTicketReplyID
WHERE 1 AND T.fkEmployeeID = '4'
AND (SELECT TIMESTAMPDIFF(DAY, TicketReplyDateAdded, now()) as NumberOfDays
FROM tickets as T
LEFT JOIN ticket_replies as TR
ON T.fkTicketReplyID=TR.pkTicketReplyID
) = 7
AND T.TicketStatus = 'Replied'
ORDER BY pkTicketReplyID DESC
谢谢你的帮助。奥马尔