我试图向用户展示本月添加到列表中的更多帖子。但不起作用。
SELECT *,SUM(post_id) FROM `posts` Where YEAR(date) = YEAR(NOW()) AND MONTH(date) = MONTH(NOW()) GROUP BY user_id ORDER BY id DESC LIMIT 0 , 18
sql表数据:
INSERT INTO `posts` (`id`, `api_id`, `user_id`, `group_id`, `message`, `mentioned`, `attached`, `posttags`, `comments`, `reshares`, `date`, `date_lastedit`, `date_lastcomment`, `ip_addr`) VALUES
(1, 0, 1, 0, 'text', 0, 0, 0, 0, 0, 1360378616, 0, 1360378616, 0);