摘要: create function [dbo].[f_getDOWN](@id int) returns @re table(id int) as begin insert into @re select id from tb_productclass where id=@id while @@rowcount>0 insert into @re select a.id from tb_productclass a inner join @re b on a.FatherId=b.id where a.id not in(select id from @re) return e... 阅读全文
posted @ 2012-10-18 13:52 放哨De老鼠 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Create FUNCTION [dbo].[f_getdate]( @begin_date Datetime, --要查询的开始日期 @end_date Datetime, --要查询的结束日期 @bz bit --@bz=0 查询工作日,@bz=1 查询休息日,@bz IS NULL 查询全部日期 )RETURNS @re TABLE(id int identity(1,1),Date datetime,Weekday nvarchar(3)) AS BEGIN DECLARE @tb TABLE(ID int IDENTITY(0,1),a bit) INSERT INTO @tb(a) 阅读全文
posted @ 2012-10-18 13:51 放哨De老鼠 阅读(137) 评论(0) 推荐(0) 编辑