I have the following Situation:-
TableA
Columns called UniqueNumber and CollectionID
TableB
RefCount and collectionID
In table a there are multiple rows with the same collectionID and what I want to do is to group how many rows have the same collection ID and then however many rows there are I want to update the refcount with this value
I have worked the first bit out as:-
select count(*) as numberofrows, collectionid from tablea
group by collectionid
This gives me each collectionid and the amount of rows that refer to this collection id.
I now want to take the values out of each of the numberofrows column and update the RefCount row in TableB with that value and this is the bit that I am stuggling with.
I hope I have made some sort of sense with my question.
MCSE NT4, 2000, 2003
TableA
Columns called UniqueNumber and CollectionID
TableB
RefCount and collectionID
In table a there are multiple rows with the same collectionID and what I want to do is to group how many rows have the same collection ID and then however many rows there are I want to update the refcount with this value
I have worked the first bit out as:-
select count(*) as numberofrows, collectionid from tablea
group by collectionid
This gives me each collectionid and the amount of rows that refer to this collection id.
I now want to take the values out of each of the numberofrows column and update the RefCount row in TableB with that value and this is the bit that I am stuggling with.
I hope I have made some sort of sense with my question.
MCSE NT4, 2000, 2003