...percentages (costid,percentage) values (3,.24)
insert into percentages (costid,percentage) values (3,.76)
select x.costid, y.percentage, x.amount*y.percentage from costs x, percentages y
where y.costid=x.costid
and y.percentageid not in
(
select max(percentageid) from percentages group...