MySQL Forums
Forum List  »  Italian

Help Query avanzata
Posted by: Giuseppe Garraffo
Date: March 02, 2010 03:30AM

Buongiorno.
Dato un elenco di prodotti, ho una tabella che caratterizza le singole proprieta' di ogni prodotto_ID. Poiche' ciascun prodotto puo' avere proprieta' differenti, la tabella "Proprieta_prodotto" e' composta nel seguente modo:
Proprieta_prodotto
Prodotto_ID | Nome_proprieta | Valore_Proprieta
1 PROP1 VALORE_X
1 PROP2 VALORE_A
2 PROP1 VALORE_Y
2 PROP3 VALORE_J
2 PROP4 VALORE_M
3 PROP2 VALORE_B
3 PROP3 VALORE_K

Adesso vorrei fare delle query per filtrare l'elenco di prodotti in base ai valori delle singole proprieta'. La cosa e' semplice se metto 1 solo filtro
(SELECT DISTINCT Prodotto_ID FROM Proprieta_prodotto WHERE Nome_proprieta = 'PROP1' and Valore_proprieta = 'VALORE_Y' ).
Ma come posso fare se volessi filtrare per piu' proprieta' differenti? Es. PROP1 = VALORE_X , PROP2 = VALORE_B e PROP3 = VALORE_K ???
Vorrei in pratica impostare un filtraggio dinamico.
Grazie!!!

Options: ReplyQuote


Subject
Views
Written By
Posted
Help Query avanzata
3734
March 02, 2010 03:30AM
2013
March 02, 2010 03:25PM


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.