create function [dbo].[f_ceshi] ( @strWhere varchar(1000) ) returns table return ( --'select * from tabelName ' + @strWhere --²éѯÓï¾äµÄwhereÌõ¼þÊÇÍⲿ¼ÆËãºó´«½øÀ´µÄ£¬ÕâÀïµÄ²éѯÓï¾äÈçºÎд¡£²¢·µ»ØÐÅÏ¢¡£
)
»»³É¹ý³Ì °É
create proc sp_ceshi @strWhere varchar(1000) as exec('select * from tabelName ' + @strWhere) go ʲô°¡£¡Äãд´íÁË SQL code:
create function [dbo].[f_ceshi] ( @strWhere varchar(1000) ) returns @temp table (id int identity(1,1), name varchar(50)) as begin return end
SQL code: create function [dbo].[f_ceshi] ( @strWhere varchar(1000) ) returns VARCHAR(8000) AS BEGIN DECLARE @S VARCHAR(8000) SET @S='select * from tabelName ' + @strWhere return @S END
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......