While I do know how to create a mathematical SQL query I am having difficulties with creating a statement involving multiple rows, each row chose by one or more attributes selected in the GUI of my program. To get a better idea of my purpose:

I have a page with 4 different part types. Each part type has multiple selectable values that are chosen by the user. When all values of each part type are chosen a total is calculated (this is the total between all 4 part types). All prices are in the same data table.

I have an idea of how this must be done (Looped SQL query) but I have never dealt with this before and would appreciate a nudge in the right direction.

Thanks for any leads you may offer.