Updating a Count of records to a table

  • I have a table which holds information for each of our salespeople (called 'assoc'). Sales people are allowed to enter their prospects (in a separate table) up to a certain limit. This limit is stored in the 'assoc' table. Daily, I need to update the count of prospects for each sales person to a field in the 'assoc' table. What it the best way to do this? I've created a view that contains the unique 'assoc' identifier and the count of prospects, but how do I update the actual 'assoc' table??

  • update assoc set count = (select * from prospects where assoc.salespersonid = prospects.salespersonid)

    Regards,

    Andy Jones

    andyj93@hotmail.com

    .

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply