if exists (select * from dbo.sysobjects where id = object_id(n[dbo].[getall]) and xtype in (nfn, nif, ntf))
【相关文章:Vista网络如何管理】 【扩展阅读:Vista如何应对互联的网络环境】drop function [dbo].[getall] 【扩展信息:IE7的权限的3个小小变化】 go--根据起始时间选择设定量、实出量、地面实出量以及出现0的情况,以查看故障信息
create function getall(@datestart datetime,@dateend datetime) returns @result table(eno int,plantotal int,facttotal int,factouttotal int,factzero int,factoutzero int) as begin declare @plan table(eno int ,plantotal int ) declare @fact table(eno int,facttotal int,factouttotal int) declare @factzero table(eno int,factzero int) declare @factoutzero table(eno int,factoutzero int)insert @plan
select electrobath_no,sum(al_p_plan) as plantotal from al_product2005 as a where (c_date between @datestart and @dateend) and (al_status<>0) and (al_p_fact<>0) and ( not exists ( select * from al_product2005 as b where (a.al_f_count < b.al_f_count) and (a.electrobath_no = b.electrobath_no) ... 下一页