Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT * FROM table WHERE createdon > SUBDATE(NOW(), '7 day') ORDER BY hits DESC;
- create table daily_hits {
- cid integer, -- content id points to the table you already have
- dotw smallint, -- 0-6 or similar
- hits integer
- PRIMARY KEY (cid, dotw)
- }
- SELECT * WHERE
- DATEDIFF(NOW(),created_date) < 7
- SELECT * FROM table WHERE Date_Created > (7 days ago value) ORDER BY Hits LIMIT 0,100
- SELECT * FROM table WHERE Date_Created > SUBDATE(NOW(), '7 day') ORDER BY Hits LIMIT 0,100
Add Comment
Please, Sign In to add comment