--´´½¨µÃµ½×î´óidµÄº¯Êý IF NOT OBJECT_ID('[f_getid]') IS NULL DROP function f_getid GO create function f_getid() returns int as begin declare @id int if not exists(select 1 from tb where id='001') set @id=1 else begin select @id=max(id) from tb if @id is null set @id=1 else begin declare @id1 int select @id1=min(id) from tb a where id<>@id and not exists(select 1 from tb where id=a.id+1)
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......