I seem to be facing an awkward situation that use TIMESTAMPDIFF function in mysql‘s query conditions. Resoures show me it could reduce execution efficiency,but I am curious about how should I proceed.
The following is my sql
SELECT personTotal.person_id
FROM personTotal
LEFT JOIN p2
ON p2.person_id = personTotal.person_id
WHERE TIMESTAMPDIFF(HOUR , personTotal.through_time, p2.through_time) < 20