X
Xine
Unregistered / Unconfirmed
GUEST, unregistred user!
select 姓名,
(select sum(工资) from 表二 where 代号=tab1.代号) as 工资总数,
(select sum(奖金) from 表三 where 代号=tab1.代号) as 奖金总数,
(select sum(工资) from 表二 where 代号=tab1.代号)+(select sum(奖金) from 表三 where 代号=tab1.代号) as 收入总数
from 表一 tab1
order by 代号
(select sum(工资) from 表二 where 代号=tab1.代号) as 工资总数,
(select sum(奖金) from 表三 where 代号=tab1.代号) as 奖金总数,
(select sum(工资) from 表二 where 代号=tab1.代号)+(select sum(奖金) from 表三 where 代号=tab1.代号) as 收入总数
from 表一 tab1
order by 代号