0

hi

i have two tables, one is products, the other is for 'discounts' on those products... when adding a new 'discount' i want to avoid adding two discounts to a single product... so i was looking for some sort of Right Join which would exclude all products which have a match in the discount table?!

Ill be using a 'select' to choose a product to add a discount to... the query needs to output all product name without a corresponding discount entry...

any ideas?

lworks

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by lifeworks
2

Something like this:

select * from product where id not in (select product_id from discount)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.