I have a table that looks like the one below. Orders appear with dates, IDs & totals. I need to calculate the FeeValue for each order.
Separately I have another table with tiered pricing.
How would I query the database to give me 10% for the first two orders & 7% for the second two?