次のクエリを実行していますが、「サブクエリが複数の行を返します」というエラーが発生しました
私のクエリは
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
ご協力いただきありがとうございます。ウマル