ANEESH T.G February 2016

How to store and update the rating from db in java

Rating range from 1-10..if 2 person rate a product then add to the current rating and need to take the average of the rating and store in db..need to work if n number of person rate the product...i just want the logic of taking the average...anyone have the code?

Answers


ANEESH T.G February 2016

itz better to store the total rating and total count of person rated in the database..just update these two field when a new person rated...there is no need to store the average..just retrieve these two and calculate average nd display it in view..

Post Status

Asked in February 2016
Viewed 3,440 times
Voted 12
Answered 1 times

Search




Leave an answer