1. The following query will take records from Person & Party tables that are in Production Database and display numbers of the ACTIVE /*in this table 1 means active user..*/users per organization.
select org_id, count (person.party_id) as num_us from production.dbo.person person
inner join
production.dbo.party party on
person.party_id = party.party_id
where curr_stat_type = 1 /*means active user*/
group by org_id
The following query is updating field called ACTIVE_ACCNTS_CNT that in Org_Links table based on the SELECT statement from the query above.
update org_links
SET enduser_cnt = num_us
Where production.dbo.party_id = production.dbo.party_id
Update query that I wrote isn't correct..
Can please somebody tell me how should i write it?
Thanks you
select org_id, count (person.party_id) as num_us from production.dbo.person person
inner join
production.dbo.party party on
person.party_id = party.party_id
where curr_stat_type = 1 /*means active user*/
group by org_id
The following query is updating field called ACTIVE_ACCNTS_CNT that in Org_Links table based on the SELECT statement from the query above.
update org_links
SET enduser_cnt = num_us
Where production.dbo.party_id = production.dbo.party_id
Update query that I wrote isn't correct..
Can please somebody tell me how should i write it?
Thanks you