摘要:
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... 阅读全文
摘要:
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) 阅读全文