maybe this question is duplicate or my query in Google wasn't right, but I have a problem) I have a 3 tables: 1. Contact (int ID, nvarchar Name) 2. City (int ID, nvarchar Name, int ContCount) 3. Adress (int ID, int CityID, int ContactID, int Year)
ContCount field - its a number of a Contacts what are living in some City (City.Name). My query for it:
SELECT COUNT(*) FROM dbo.Adresses WHERE dbo.Adresses.City_ID = 1
Here is my question: I need to my ContCount field assign a result of this query. Can you help me? How can I do it?
P.S. Sorry for my English=)
updatetheContCountfor all cities in the City table? Or do you just want theContCountfor a particularCity_ID?