sql,update,table,with,group,by,select,inner,sql

Kubilay 6/23/2018 0

This code block updates rows by inner sql with group by

PL/SQL
UPDATE [Company] 
SET MembersCount = i.Sayi
FROM (
SELECT COUNT(*) as Sayi ,
CompanyId
FROM MemberCompany where IsApproved=1 and RoleId<>5 group by CompanyId) i
WHERE 
i.CompanyId = [Company].Id 

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments