I know this has been asked a dozen times here at stackoverflow, but it is driving me mad.
I have two tables:
- card_lookup_values (which contains:
card_id, card_price) - card_sales (which contains:
discount_price)
They both contain card_id (so I know I can join them there), but how exactly would I join them? What I am trying to accomplish is to multiply the card’s price it’s discount price to get the actual sale price, but it is proving to be a real head scratcher.
Or, if your discounts are something like “20% off”, the following subtracts the amount discounted (discount * original) from the original to return the new price.