2 ms·
SELECT * FROM comments WHERE posted_at > SUBDATE(NOW(), INTERVAL 1 DAY) ORDER BY karma DESC LIMIT 50; My SQL might be a bit rusty, but you get the gist of it.
by paulgb 18y ago
SELECT * FROM comments WHERE posted_at > SUBDATE(NOW(), INTERVAL 1 DAY) ORDER BY karma DESC LIMIT 50;
My SQL might be a bit rusty, but you get the gist of it. Why not do that?
Your question is a little confusing without knowing the schema you are using already. Do you want the top comments of each hour?