MySQL Forums
Forum List  »  Newbie

Aquestions about a query
Posted by: Martial
Date: April 22, 2005 07:48AM

At first i would show the used table

Table 1
User_prescription_ID
prescription_ID
User_ID


Table 2
Store_ID
User_ID
ressource_ID
Quantity

Table 3
ressource_prescription_ID
prescription_ID
ressource_ID
needed_Quantity


Now i have the prescription_ID
I would have all user which have enough resources and the prescription

my attempt:

SELECT
User_prescription.User_ID
FROM
Table1 User_prescription, Table2 Store, Table3 ressource_prescription
WHERE
User_prescription.prescription_ID = 2 AND
ressource_prescription.prescription_ID = User_prescription.prescription_ID AND
Store.User_ID = User_prescription_ID.User_ID AND
Store.ressource_ID = ressource_prescription.ressource_ID AND
Store.Quantity >= ressource_prescription.needed_Quantity


Now i have all ressource of users which have more than needed ressource and the prescription but i have some user which have not all ressource_ID

Please can you help me

Options: ReplyQuote


Subject
Written By
Posted
Aquestions about a query
April 22, 2005 07:48AM


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.