select * from C_Discount D,C_Users U
----------------------------------------------
ID DiscountName Discount Required
1 九折 9.5 100
2 九折 9.1 100
如何在Required这一列相同的情况下,选择DISCOUNT列比较大的一行,就选一行
------解决方案--------------------
select * from tb t where not exists(select 1 from tb where Required=t.Required and Discount>t.Discount)
select * from tb t where Discount=(select max(Discount) from tb where Required=t.Required