日期:2014-05-17 浏览次数:20433 次
--不能直接使用,换个方式 select aaa_id,aaa_name,aaa_value,bbb_value,aaa_value/bbb_value as ccc from ( select aaa_id,aaa_name,aaa_value,(select sum(bbb_value) from bbb where bbb_id=aaa_reid) as bbb_value from aaa ) t --or select aaa_id,aaa_name,aaa_value,(select sum(bbb_value) from bbb where bbb_id=aaa_reid) as bbb_value,aaa_value/(select sum(bbb_value) from bbb where bbb_id=aaa_reid) as ccc from aaa