改过来了,还是不行
再帮我瞧瞧好么
create procedure proc_print
@wage money out,
@count int out,@num int out,@money money out
as
set @wage=(select aw.avg_wage
from (select avg(wage) as avg_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as aw)set @count=(select an.sex_wage
from (select count(sex) as sex_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as an)select * from Employees
go
declare @wage money
declare @money money
declare @count int
declare @num intexecute proc_print @money=@wage out,@num=@count out
print(convert(nvarchar(40),@money))
print(convert(nvarchar(40),@num))
再帮我瞧瞧好么
create procedure proc_print
@wage money out,
@count int out,@num int out,@money money out
as
set @wage=(select aw.avg_wage
from (select avg(wage) as avg_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as aw)set @count=(select an.sex_wage
from (select count(sex) as sex_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as an)select * from Employees
go
declare @wage money
declare @money money
declare @count int
declare @num intexecute proc_print @money=@wage out,@num=@count out
print(convert(nvarchar(40),@money))
print(convert(nvarchar(40),@num))
过程 'proc_print' 需要参数 '@wage',但未提供该参数。
过程 'proc_print' 需要参数 '@wage',但未提供该参数。
第一步存储过程可以建立,这是第二步的错误
执行时:declare @wage money
declare @money money
declare @count int
declare @num intexecute proc_print @wage out,count out,@num out,@money out
print(convert(nvarchar(40),@wage))
print(convert(nvarchar(40),@num))
@wage money out,
@count int out
as
set @wage=(select aw.avg_wage
from (select avg(wage) as avg_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as aw)set @count=(select an.sex_wage
from (select count(sex) as sex_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as an)select * from Employees
go
declare @wage money
declare @count intexecute proc_print @wage out,@count out
print(convert(nvarchar(40),@wage))
print(convert(nvarchar(40),@count))
create procedure proc_print
@wage money out,
@count int out,@num int out,@money money out
as
set @wage=(select aw.avg_wage
from (select avg(wage) as avg_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as aw)set @count=(select an.sex_wage
from (select count(sex) as sex_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as an)select * from Employees
go
declare @wage money
declare @money money
declare @count int
declare @num intexecute proc_print @wage out,@count out,@num out,@money out
select (convert(nvarchar(40),@money)),(convert(nvarchar(40),@num))
您的方法是对的,搞定了,谢谢了