求给一个查询表添加字段,该如何解决
求给一个查询表添加字段我想在后面追加一个列显示 4500+ 5 * 0.1怎么做[解决办法]select U.UserName,S.Bas
求给一个查询表添加字段
我想在后面追加一个列显示 4500+ 5 * 0.1 怎么做
[解决办法]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 as Reault--这样既可
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
[解决办法]try this,
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