有3个表
APPLY(职位申请表):pid,jid,zid,new,need_date
work_job(工作职位表):jid ,job_title,people,jdate,efficiency_date
person(人才表):person_name,......
现在是要统计包含APPLY表里包含jid的pid总数有多少,其中new为0的有多少?
我写的存储过程如下
CREATE PROCEDURE dbo.show_job
@user_name nvarchar(50)
as
declare @jid int,
@job_title nvarchar(150),
@aa smallint,
@bb smallint
select * from dbo.apply_job where user_name=@user_name
set @jid=jid
set @job_title=job_title
set @aa=select count(@jid) from apply ,
@bb=select count(@jid) from apply where new='0'
return @jid
return @aa
return @bb
return @job_title
if @@error>0
goto error
error:
return -1
GO
烦请各位大侠看看可以不可以
但是在SQL SERVER中测试有错误!
|