如何从 slab 范围中查找值

How to find value from a slab range

我需要根据金额过滤佣金意味着我给出了 300000 之类的金额并获得了匹配 300000 的那些板块的佣金

SlabStartAmount SlabEndAmount CommissionAmount
100000 200000 62.5
2000001 5000000 75
5000001 7500000 81.25
7500001 10000000 87.5
10000001 0 100

你可以使用一个条件来找出slab

WHERE @Amount BETWEEN SlabStartAmount AND SlabEndAmount

this fiddle