MySQL Forums
Forum List  »  Oracle

Update statement with select - help please ;)
Posted by: Gavin Reynolds
Date: March 18, 2010 11:16AM

Hi, really easy one here i'm sure but i cannot seem to get it to work

table asd_a (userid | name | average)
table asd_b (userid | rating)

asd_a contains a unique userid (e.g.001)
asd_b stores multiple ratings (1 to 5) against the userid

I can display the average score for each userid;
select round((sum(rating)/count(rating)),1) as average from asd_b where id = '001';

what I want to do is UPDATE the 'average' field in asd_a for each of the userid's

Any help would be greatly appreciated

Options: ReplyQuote


Subject
Views
Written By
Posted
Update statement with select - help please ;)
4667
March 18, 2010 11:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.