Hello, i`m trying since morning to get a result.
I have a users table and a table which holds products for selling..
Each user has the option to mark several products as 'special'.
i need a list which contains the name of the 'special' products which belong to the first 5 users who have the highest number of products.
users(user_id,user_name)
products(product_name,product_special,user_id)
select count(user_id),user_name as no
from users
natural join products
order by no desc
limit 5 -> this query shows the first 5 users which have the most products
select product_name,user_name
natural join users
where product_special='1' -> this query shows all the 'special' products
I need the result of the two queries combined somehow.
thanks!