Hi, I have the following query:
select d.restaurant_id, restaurant_category, dish_name, cuisine_id, count(ingredient_id)
from restaurant r, dish d, composition c
where r.restaurant_id = d.restaurant_id
and d.restaurant_id = c.restaurant_id
and d.dish_id = c.dish_id
group by d.restaurant_id
having count(distinct cuisine_id) > 1;
The tables are the following:
- restaurant(restaurant_id, restaurant_category)
- dish(restaurant_id, dish_name, dish_id, cuisine_id)
- composition(restaurant_id, dish_id, ingredient_id)
The query it's returning only one row when it should be returning 3. Any ideas?