I am trying to find, for shop S9, the friend of the user who posted the most number of reviews for it.
I have the following query:
select friend_id
from friends
where user_id = ( select author_id
from posted_reviews_tab
where rownum <= 1
and reviewid in ( select w.reviews.reviewid
from wall_tab w
where w.shopid = 'S9' )
group by author_id
order by count(author_id) desc );
I get the following error:
SQL Error: ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis"