I have following code:
SELECT *
FROM tier
WHERE
TIMESTAMPDIFF( HOUR, now(), FROM_UNIXTIME(expireAt) ) < 72
AND TIMESTAMPDIFF( HOUR, now(), FROM_UNIXTIME(expireAt) ) > 0
You can see, that there is a TIMESTAMPDIFF
calculation twice.
Is there any way how to perform this calculation only once?