CREATE PROCEDURE dbo.Z3prifix_1
(
@hid_fix_dan int,
@hpri_fix float output,
@hfix_time float
)
AS
BEGIN
select
@hpri_fix = @hfix_time * a.gpay_hour
from
Z3 a,Z2 b
where
a.hid_no = b.gid_no
and
a.hid_fix_dan = @hid_fix_dan
return
END
GO
(
@hid_fix_dan int,
@hpri_fix float output,
@hfix_time float
)
AS
BEGIN
select
@hpri_fix = @hfix_time * a.gpay_hour
from
Z3 a,Z2 b
where
a.hid_no = b.gid_no
and
a.hid_fix_dan = @hid_fix_dan
return
END
GO
FROM dbo.Z2
WHERE gid_no=dbo.Z3.hid_no)
from Z3
where hid_fix_dan = @hid_fix_dan
是不是select后面不能跟子查询的?
vivianfdlpw() 你的还是不行
当然,你也可以用存储过程的。CREATE view v3 -- 修理费
as
select 修理作业表.RID RID, -- 修理作业表的序号
工资表.工资 * 修理作业表.修理时间 RepairFee
from 修理作业表 left outer join 工资表 on 修理作业表.工号=工资表.工号