在 bugzilla 中添加过滤器以查询用户所属的组
select
profiles.realname as User_Name,
sum(ba.added) as Hours_Worked
from
bugs_activity ba join user_group_map u on ba.who = u.user_id
join profiles on ba.who = profiles.userid
where
u.group_id = '15' and
ba.fieldid = '47' and
YEARweek(ba.bug_when) = YEARweek(CURRENT_DATE)
group by ba.who;
此查询现在可以查找组中用户的时间。
我在这个网站上从其他用户的帖子中学到了很多东西,谢谢大家。
select
profiles.realname as User_Name,
sum(ba.added) as Hours_Worked
from
bugs_activity ba join user_group_map u on ba.who = u.user_id
join profiles on ba.who = profiles.userid
where
u.group_id = '15' and
ba.fieldid = '47' and
YEARweek(ba.bug_when) = YEARweek(CURRENT_DATE)
group by ba.who;
This query now can find the time for users in a group.
I have learned lot on this site from other users posts, thanks everyone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在不知道有问题的架构或您真正想要如何过滤的情况下,我能做的最好的事情就是向您指出一些有关如何使用 JOIN 的信息:
SQL 连接
Without knowing the schema in question, or how you really want to filter, the best I can do is point you at some info on how to use JOINs:
SQL Joins
用脚本更新了我原来的问题,用我想出的脚本。
Updated my original question with the script, with the script I figured out.