I have a table that stores product price information. It has a column for the product ID, a quantity and a discount. (Users buys 2 gets £1 off, buys 3 gets £2 off etc).
I’d like to pull all products that have specific quantity discounts associated with them. For example only products that have £5, £10 and £20 off buying 1,2 or 3 respectively.
How can I do that?
I want to group by product ID where there is are three rows that match my criteria – and no other products.
Not tested (depends on your schema) but here’s the idea: