读书人

函数功课

发布时间: 2012-08-26 16:48:06 作者: rapoo

函数作业
--函数
create function fnGetAllAccept(@SDate datetime, @wh_id int, @cust_id int)
returns table as
return (select Acc_code, Cust_id, Acc_type, Acc_remark
from AcceptBlotter
where Wh_id = @wh_id AND cust_id = @cust_id AND Acc_date >= @SDate
)

--测试
select * from fnGetAllAccept('2000-1-1', 10, 100)

读书人网 >其他数据库

热点推荐