Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sql function exec

SQL code:


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




º¯ÊýÀïÃæ²»Äܶ¯Ì¬,Ҫô¸Ä³É´æ´¢¹ý³Ì,Òª·´ÏÈ·µ»Ø×Ö·û,ÔÙEXEC(@S)

ÒýÓÃ
SQL codecreatefunction[dbo].[f_ceshi]
(@strWherevarchar(1000)
)returnstablereturn
(--'select * from tabelName ' + @strWhere--²éѯÓï¾äµÄwhereÌõ¼þÊÇÍⲿ¼ÆËãºó´«½øÀ´µÄ£¬ÕâÀïµÄ²éѯÓï¾äÈçºÎд¡£²¢·µ»ØÐ


Ïà¹ØÎÊ´ð£º

Asp+sql serverÎÊÌâ - Web ¿ª·¢ / ASP

ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º ......

sql - MS-SQL Server / ÒÉÄÑÎÊÌâ

sqlµÄÈí¼þÔÚÄÄÀï¿ÉÒÔϰ¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»Á˰¡

Ëæ±ã¸ãÒ»D°æ°É£¬

ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓÃ
2000,2005¶¼ÕâÑù

http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......

ÈçºÎʹÓÃMySQL - MS-SQL Server / »ù´¡Àà

¸Õ¸Õ½Ó´¥MySQL,²»ÖªµÀ¸ÃÈçºÎÈ¥²é¿´Êý¾Ý£¬²åÈëÊý¾Ý£¬´´½¨Êý¾Ý¿â¡¢±í£¬ÓÃÄÄΪǰ±²ÄÜÖ¸½ÌÒ»¶þ£¿

MySQL 5.1²Î¿¼ÊÖ²á

ÒýÓÃ
ÐÖµÜÄã»á½áÌùÂð£¿
mysql ²Î¿¼ÊÖ²á

baidu

MySQL¹Ù·½Îĵµ http://dev.mysql.com/doc ......

Á½¾äSQL²¢Ò»¾ä,ÓÐÎÊÌâ. - MS-SQL Server / »ù´¡Àà

µÚÒ»¾ä:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ