views:

23

answers:

1

I have this

SELECT COUNT(1) cnt, a.auther_id
    FROM `posts` a 
    LEFT JOIN users u ON a.auther_id = u.id
    GROUP BY a.auther_id
    ORDER BY cnt DESC
    LIMIT 20

It works fine, but now I want select posts from within the last day. I tried to use

    WHERE from_unixtime(post_time) >= SUBDATE(NOW(),1) 

but it didn't work. Any one have idea why?

A: 

This may work:

WHERE FROM_UNIXTIME(post_time) >= SUBDATE(NOW(), INTERVAL 1 DAY)
Bryson