如何用SQL查询获取phpBB用户的月度postcount?

时间:2016-01-07 13:22:33

标签: mysql sql phpbb phpbb3

我是这个SQL的新手,与phpmyadmin一起工作。我已经设法获得所有用户名,但不知道如何获得postcount,特别是在定义的时间(月)周期内进行后置。这是我到目前为止所得到的:

SELECT DISTINCT
  ug.`user_id`,
  u.`username`,
  pfd.`pf_full_name`
FROM
  `phpbb3_user_group` AS ug
INNER JOIN
  `phpbb3_groups` AS g ON g.group_name = 'User'
INNER JOIN
  `phpbb3_users` AS u ON u.`user_id` = ug.`user_id`
INNER JOIN
  `phpbb3_profile_fields_data` AS pfd ON pfd.`user_id` = ug.`user_id`
WHERE
  ug.`group_id` = g.`group_id` AND u.`user_type` = 0
ORDER BY
  ug.`user_id`

0 个答案:

没有答案