New problem with join table
Posted: Fri Feb 20, 2004 3:01 pm
I have 3 tables:
1) products: id_product, name, group, price, quantity, avilablity
2) user: login, pass, group
3) discount: id_product, group, rabate
Diffrent users has different discount on different product, I have a list for example:
1, table, group_a, 100$
2, chair, group_b, 50$
but I have 10% for products 'a' and 10% for products 'b' discount on that product so it should print
1, table, group_a, 90$
2, chair, group_b, 45$
other client have 20% for 'a' and 10% for 'b'... etc.
I dont know how to write query that can show table 'products' after rabate, different for each user depend who logs in. Maybe change in tables structure t make that problem easier?
Thx for help, sory for my english :]
1) products: id_product, name, group, price, quantity, avilablity
2) user: login, pass, group
3) discount: id_product, group, rabate
Diffrent users has different discount on different product, I have a list for example:
1, table, group_a, 100$
2, chair, group_b, 50$
but I have 10% for products 'a' and 10% for products 'b' discount on that product so it should print
1, table, group_a, 90$
2, chair, group_b, 45$
other client have 20% for 'a' and 10% for 'b'... etc.
I dont know how to write query that can show table 'products' after rabate, different for each user depend who logs in. Maybe change in tables structure t make that problem easier?
Thx for help, sory for my english :]