Select and sum data from a oracle table containing duplicates
You are almost right, just add below date check for 24 hours.

SELECT t3.rec_id AS"Id", COUNT(t3.rec_id) AS"Num messages" 
FROM TABLE3 t3 INNER JOIN TABLE2 t2
ON t2.id=t3.rec_id
INNER JOIN TABLE1 t1 
ON t2.id=t1.id
WHERE t2.active='1' 
  AND t1.block='0'
  AND t1.valid like 'false'
  AND t1.block_date &lt; sysdate - 1
GROUP BY t3.rec_id
ORDER BY COUNT (t3.rec_id) DESC