I'd like to add a column to a table whose value counts the number of times it is repeated on another table. Something like this:
Name NameID Quantity | NameID Franchisee Business BusinessID
John 12345 2 | 12345 CA Laundry 45678
Smith 45684 1 | 12345 CA Bakery 45679
| 45684 NY Shampoo 45680
The column Quantity is the one I want to add, I want it to count all the BusinessID that belong to his NameID: John has a NameId of 12345 and that NameID has 2 BusinessIDs assosiated to it.
I don't know how to do this, I want to add this value to an aspx project, maybe it'd be easier to make a function in c# to keep the DB as is and just show the values on the client.