Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct product_name
- from order_details, products, (
- select order_id, count(product_id) as product_number
- from order_details
- group by order_id)t1,(
- select distinct order_id
- from orders, customers
- where orders.customer_id = customers.customer_id
- and country = 'Germany')t2
- where t1.product_number < 5
- and t1.order_id = t2.order_id
- and order_details.order_id = t1.order_id
- and products.product_id = order_details.product_id
- order by product_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement