原文:
How to See How Many Emails Were Sent To A User?
Applies to:
Oracle Agile Product Collaboration - Version: 9.2.2.1 and later [Release: 9.2.0.0 and later ]
Information in this document applies to any platform.
Goal
Is there a query (sql) that will give a count of how many email notifications where sent over the past 2 weeks to a user?
Solution
select count(*) from notification_user where notiuser_user_fk in (select id from agileuser where loginid='UserLogin') and notiuser_date_created > (sysdate - (16));
Note: Change the loginid='UserLogin' to the users username and this will give you the current systems date (todays date) back to16 days ago (two weeks), if you would like to know more days change the 16 to a higher number e.g. one month would be 30
Note: If the user has deleted notifications these will not be counted
译文:
怎么样查看给一个用户发了多少邮件?
版本:9.2.2.1或者更高版本[9.2.0.0或者更新版本]
目标:
有没有一个查询的SQL语句,能够查出在过去两周内给一个用户一共发了多少条邮件通知?
解决方案:
select count(*) from notification_user where notiuser_user_fk in (select id from agileuser where loginid='UserLogin') and notiuser_date_created > (sysdate - (16));
注意:修改loginid=’UserLogin’中的userLogin为具体的用户名,这个SQL语句,将为你查询从当前系统时间开始到过去16天(两周)内发送邮件的数量,如果你想要查询的天数大于16天,那么直接修改16就能做做,比如要查询30天以前的邮件数量,可以修改把16改为30。
注意:用户已经删除的邮件通知不会被记录在这个查询中。