MySQL Forums
Forum List  »  General

Between with multiple requirements
Posted by: Solipso Agar
Date: January 14, 2011 08:53AM

I need to make a view that compares a value a customer wishes a product to have (kw.PValue) and the possible values a product can achieve (pp.PValueMin and pp.PValueMax)

I have the following view:

SELECT DISTINCT
apk.ProductID,
apk.name,
apk.customername
FROM
comparisonproductcustomer AS apk,
customerwishes AS kw,
productparameters AS pp,
customer AS k,
product AS p
WHERE
apk.ProductID = p.MID
AND apk.customername = k.Name
AND k.FID = kw.FID
AND p.MID = pp.Product_MID
AND kw.PName = pp.PName
AND kw.PValue BETWEEN pp.PValueMin AND pp.PValueMax

The problem is, that it will show me all the products that fulfill at least 1 wish of the customer. I want it to show me the products that fulfill ALL the wishes of the customer though. So if there is more than 1 requirement of the customer, i don't want it to show me products that just cover 1 requirement.

How would i be able to achieve that?

I would be very grateful for any assistance. Thanks in advance



Edited 1 time(s). Last edit at 01/14/2011 09:06AM by Solipso Agar.

Options: ReplyQuote


Subject
Written By
Posted
Between with multiple requirements
January 14, 2011 08:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.