Answer the question
In order to leave comments, you need to log in
MySql: How to make a selection from one table based on another?
Hello, there are 2 tables "Warehouses" and "Products" they are connected 1 to many, there can be several goods in one warehouse. What would be the correct query to pull out from the table all the warehouses in which there are more than 3 products?
Answer the question
In order to leave comments, you need to log in
select
w.name
from warehouse as w
inner join goods as g
on w.id = g.warehouse_id
group by w.id
having count(g.id) > 3;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question