I'll explain my problem using a little example
table
article name price
-------------------------------
art1 Default 10
art2 Default 15
art2 Egmond 12
art3 Default 20
art3 Windels 17
Goal:
Article prices are saved with customer name Default. When one customer has a specific price, the customer's name is used (ex. customer Egmond can buy article art2 for 12 €; other customers have to pay 15 €).
If a customer has no specific price for an article, the default price must be shown.
Using one query, I should be able to get the catalog for customer Egmond:
art1 10 €
art2 12 €
art3 20 €
Can somebody help me?
table
article name price
-------------------------------
art1 Default 10
art2 Default 15
art2 Egmond 12
art3 Default 20
art3 Windels 17
Goal:
Article prices are saved with customer name Default. When one customer has a specific price, the customer's name is used (ex. customer Egmond can buy article art2 for 12 €; other customers have to pay 15 €).
If a customer has no specific price for an article, the default price must be shown.
Using one query, I should be able to get the catalog for customer Egmond:
art1 10 €
art2 12 €
art3 20 €
Can somebody help me?
Comment