Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update multiple rows in single column

772647May 12 2010 — edited May 12 2010
I have table grocery_05support_measures with the following attributes:
ID
antecedent
consequent
coverage

All values in the coverage column are currently null for all records. The table has > 37k rows. I would like to update this column to store a probability calculation, which will be different for each row in the table. I have the following:

update grocery_05Support_measures
set coverage = select count(antecedent)/(Select count(antecedent)
from grocery_05Support) * 100
from grocery_05Support
group by antecedent);

The subquery, of course, returns multiple rows. Could anyone provide any assistance how it can be rewritten in order to update current existing rows with the appropriate calculated value? Any assistance is greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2010
Added on May 12 2010
11 comments
5,544 views