我正在尝试做这样的事情:
User_guid | Post Message | Discussion board | Total |
1 | 300 | 25 | 325 |
2 | 15 | 185 | 200 |
3 | 100 | 203 | 303 |
但我不知道怎么做。
我有这个查询的 Post Message 结果:
SELECT COUNT( * ) as 'Quantidade' , users_entity.name , users_entity.username
FROM river
JOIN users_entity
ON river.subject_guid = users_entity.guid
AND river.action_type = 'create'
AND river.view = 'river/object/thewire/create'
GROUP BY river.subject_guid ORDER BY 'Quantidade' DESC
我有这个查询的讨论结果:
SELECT COUNT( * ) as 'Quantidade' , users_entity.name , users_entity.username
FROM river
JOIN users_entity
ON river.subject_guid = users_entity.guid
AND river.action_type = 'reply'
GROUP BY river.subject_guid ORDER BY 'Quantidade' DESC
但我不知道如何将这些结果作为 users_entity 表的行加入。总交互应该是帖子消息和讨论板值的总和。有人可以帮助我吗?谢谢。