日期:2014-05-17 浏览次数:20474 次
select U.UserName,S.BasicSalary,(select sum(SalesNumber) from SalesTable where UserID=1)as
counter,Z.SalaryDownList,Z.SalaryUpList,Z.SalaryRate from dbo.UserList as
U inner join dbo.SalaryTable as S on S.UserID=U.UserID
inner join dbo.SalesTable as T on T.UserID=U.UserID inner join SalaryClassify as Z on
(select sum(SalesNumber) from SalesTable where UserID=1) between SalaryDownList and
SalaryUpList
select U.UserName,S.BasicSalary,
(select sum(SalesNumber) from SalesTable where UserID=1) as counter,
Z.SalaryDownList,Z.SalaryUpList,Z.SalaryRate,
S.BasicSalary+5*Z.SalaryRate
from dbo.UserList as U
inner join dbo.SalaryTable as S on S.UserID=U.UserID
inner join dbo.SalesTable as T on T.UserID=U.UserID
inner join SalaryClassify as Z on
(select sum(SalesNumber) from SalesTable where UserID=1)
between SalaryDownList and SalaryUpList