hi guys, I have 2 tables, one called neworders which stores the part_id and num or parts and a 2nd table called parts which has all the part details including cost.
tables are as follows
neworder
part_id(primary key)
number_of_parts
parts
part_id(primary key)
7-8 more columns, eg size, desc, sup id
cost
what i need to do is get the sum of the costs based on the quantity of the parts ordered
so if table is as follows
table new order
part_id number_of_parts
pt12 2
pt255 4
I need to use the part_id of the neworder table to get the costs of the parts and then add them up with sum based on number of parts ordered.
I have no idea how to do this, any help would be awesome