-
updating count fields
I have to build a database of firms that can have more than one address. It is formed by two Tables:
Table1 Firms
Fields
FirmID Firm name Number_of_sites
Table2 Addresses
SiteID FirmID SiteAddress
Do you know if I can update the Number_of_sites field by using an UPDATE query with a count on the fields of the second table joined to the ones of the first?
-
update Firm
set Number_of_sites = (select count(*)
from Addresses
where FirmID = Firm.FirmID)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|