------解决方案-------------------- 如果id是1,2,3顺序排列的话就这样取 select id,money,money/400 rate from t where id<=(select count(*)-1 from t) union select id,money,1-(select sum(rate) from (select id,money,money/400 rate from t where id<=(select count(*)-1 from t)) ) from t
------解决方案-------------------- 修改表中的值 update t a set rate=(select money/400 from t b where a.id=b.id) update t set rate=(select 1-sum(rate) from t where rownum<(select count(id) from t)) where id=(select max(id) from t)
------解决方案-------------------- 修改下: