How to combine these two queries?
select mysql query:
SELECT avg(b.averageRating)
FROM review a INNER
JOIN review b ON b.institudeId=a.institudeId
WHERE a.reviewId='3';
update mysql query:
update table institutions
set averageRatings=avg(b.averageRating)
where id=a.institudeId;
source
share