SQLÖÐescapeµÄÖ÷ÒªÓÃ;
1.ʹÓà ESCAPE ¹Ø¼ü×Ö¶¨ÒåתÒå·û¡£ ÔÚģʽÖУ¬µ±×ªÒå·ûÖÃÓÚͨÅä·û֮ǰʱ£¬¸ÃͨÅä·û¾Í½âÊÍΪÆÕͨ×Ö·û¡£ÀýÈ磬ҪËÑË÷ÔÚÈÎÒâλÖðüº¬×Ö·û´® 5% µÄ×Ö·û´®£¬ÇëʹÓ㺠WHERE ColumnA LIKE '%5/%%' ESCAPE '/'
2.ESCAPE 'escape_character' ÔÊÐíÔÚ×Ö·û´®ÖÐËÑË÷ͨÅä·û¶ø²»Êǽ«Æä×÷ΪͨÅä·ûʹÓᣠescape_character ÊÇ·ÅÔÚͨÅä·ûÇ°±íʾ´ËÌØÊâÓÃ;µÄ×Ö·û¡£ SELECT * from finances WHERE description LIKE 'gs_' ESCAPE 'S' Òâ˼¾ÍÊÇ£º ±ÈÈ磬ÎÒÃÇÒªËÑË÷Ò»¸ö×Ö·û´® "g_" ,Èç¹ûÖ±½Ó like "g_"£¬ÄÇô "_"µÄ×÷ÓþÍÊÇͨÅä·û£¬¶ø²»ÊÇ×Ö·û£¬½á¹û£¬ÎÒÃÇ»á²éµ½±ÈÈç "ga","gb","gc",¶ø²»ÊÇÎÒÃÇÐèÒªµÄ "g_". Óà LIKE 'gs_' ESCAPE 'S' 's'±íʾÌØÊâÓ÷¨±êÖ¾
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
SQL´¥·¢Æ÷ʵÀý½²½â
2008-10-31 21:06
SQL´¥·¢Æ÷ʵÀý1
¶¨Ò壺 ºÎΪ´¥·¢Æ÷£¿ÔÚSQL ServerÀïÃæÒ²¾ÍÊǶÔijһ¸ö±íµÄÒ»¶¨µÄ²Ù×÷£¬´¥·¢Ä³ÖÖÌõ¼þ£¬´Ó¶øÖ´ÐеÄÒ»¶Î³ÌÐò¡£´¥·¢Æ÷ÊÇÒ»¸öÌØÊâµÄ´æ´¢¹ý³Ì¡£
³£¼ûµÄ´¥·¢Æ÷ÓÐÈýÖÖ£º·Ö±ðÓ¦ÓÃÓÚInsert , Update , Delete ʼþ¡£
&nbs ......
¡¡¡¡º¯ÊýÊÇÒ»ÖÖÓÐÁã¸ö»ò¶à¸ö²ÎÊý²¢ÇÒÓÐÒ»¸ö·µ»ØÖµµÄ³ÌÐò¡£ÔÚSQLÖÐOracleÄÚ½¨ÁËһϵÁк¯Êý£¬ÕâЩº¯Êý¶¼¿É±»³ÆΪSQL»òPL/SQLÓï¾ä£¬º¯ÊýÖ÷Òª·ÖΪÁ½´óÀࣺ
¡¡¡¡ µ¥Ðк¯Êý
¡¡¡¡ ×麯Êý
¡¡¡¡±¾ÎĽ«ÌÖÂÛÈçºÎÀûÓõ¥Ðк¯ÊýÒÔ¼°Ê¹ÓùæÔò¡£
¡¡¡¡SQLÖеĵ¥Ðк¯Êý
¡¡¡¡SQLºÍPL/SQLÖÐ×Ô´øºÜ¶àÀàÐ͵ĺ¯Êý£¬ÓÐ×Ö·û¡¢Êý×Ö¡¢ÈÕÆÚ¡ ......
select * from formtable_main_20
sp_help formtable_main_20
--drop view zcountQJ01
create view zcountQJ01
as
select appman ,year(startdata) as zyear,jb,cast(sum(num) as decimal(4,1) ) as num
from formtable_main_20
where year(getdate()) = year(startdata)
group by appman,jb,year(startdata) ......
ÌâÄ¿ÒªÇó
°¢ÀïbabaµÄÃæÊÔÌâ
ÓÐÈý¸ö±í
ѧÉú±í S
SID SNAME
½Ìʦ¿Î±í T
TID TNAME TCL
³É¼¨±í SC &n ......