MySQL Forums
Forum List  »  Newbie

Count in where clause only id's from 2 tables
Posted by: Hassan Yigit
Date: October 01, 2014 10:05PM

Hello dear community.

i am new here and i need your help.

I have a complicated task. At least for me.
I need a query to get restaurants with conditions over 3 tables.

So far everything is ok. But this part makes me problems.

[WHERE CLAUSE]...AND (SELECT *, AVG(rating) FROM restaurants, ratings WHERE restaurants.id = ratings.restaurantid) BETWEEN '" . $ratingmin . "' AND '" . $ratingmax . "'...

Sorry if its absolutely wrong :)

I need the average of ratings in where clause collected by the restaurant id which is in 2 tables (The desired value is variable->BETWEEN).

Can you help me pls? Thank you!

Options: ReplyQuote


Subject
Written By
Posted
Count in where clause only id's from 2 tables
October 01, 2014 10:05PM


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.