0% found this document useful (0 votes)
2 views1 page

UsageQuery

The document contains SQL queries to retrieve data related to 'Daily Activities Summary' usage by companies. The first query lists enabled companies with their IDs and names, while the second query counts the number of users associated with these companies. Both queries filter out demo companies and only include active companies.

Uploaded by

mak.ronaldo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

UsageQuery

The document contains SQL queries to retrieve data related to 'Daily Activities Summary' usage by companies. The first query lists enabled companies with their IDs and names, while the second query counts the number of users associated with these companies. Both queries filter out demo companies and only include active companies.

Uploaded by

mak.ronaldo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--COS_PROD

--Daily Activities Summary Usage Company Count


select CD.company_id,CD.company_name from company_app_notification can
inner join Company_Details CD on cd.company_id=can.company_id
inner join app_notification an on an.appnotifyid=can.appnotifyid
where an.notifymodule=21 --Daily Activities Summary
and can.isEnable=1 and CD.company_status = 1 and isnull(CD.IsDemoCompany,0) != 1
order by CD.company_id,CD.company_name

--Daily Activities Summary Usage Family Count


select CD.company_id,CD.company_name,
isnull(count(UAN.User_Id),0)as UserCount
from company_app_notification can
inner join Company_Details CD on cd.company_id=can.company_id
inner join app_notification an on an.appnotifyid=can.appnotifyid
inner join user_app_notification UAN on UAN.Company_Id = cd.company_id
and uan.companyNotifyId=can.companyNotifyId and UAN.isEnable=1
where an.notifymodule=21 --Daily Activities Summary
and can.isEnable=1 and CD.company_status = 1 and isnull(CD.IsDemoCompany,0) != 1
GROUP BY CD.company_id,CD.company_name
order by CD.company_id,CD.company_name

You might also like