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

cobolдsqlÃüÁî

SQLÖÐWHERE×Ó¾äÖпÉÒÔÀûÓÃLIKEÀ´Æ¥ÅäÏàËƵÄÊý¾ÝÏµ±Ê±Îҵõ½µÄ½áÂÛÊÇ¿ÉÒÔʹÓÃ"%"À´Æ¥Åä×Ö·û´®£¬ÔÚSPUFIÖÐʹÓ㬵ÄÈ·¿ÉÒԵõ½×Ö·û´®Æ¥ÅäµÄЧ¹û¡£È磺
    SELECT * from TEST
          WHERE TESTID LIKE "CZX%";
    ÉÏÃæÕâ¾äÔÚSPUFIÖÐÌá½»Ö´Ðк󣬾ͿÉÒÔ½«TEST±íÖÐËùÓÐTESTIDÖÐËùÓÐÒÔ"CZX"×Ö·û´®¿ªÍ·µÄÏÕÒµ½¡£
    È»¶ø£¬ÔÚCOBOLÖÐÖ´ÐÐǶÈëµÄSQLÓï¾äµÄʱºò£¬"%"¾ÍÖ»ÄÜÆ¥ÅäÒ»¸ö»ò¿ÕµÄ×Ö·ûÁË£¬È磺
    EXEC SQL
         SELECT * from TEST
                WHERE TESTID LIKE "CZX%"
    END-EXEC.
    ¾ÍÖ»Äܲéѯ³öÒÔ"CZX"¿ªÍ·µÄÇÒ×îºó³¤¶È²»³¬¹ý4µÄÏî¡£
    Ò»¿ªÊ¼µÄʱºòÎÒ²¢Ã»ÓÐ×¢Òâµ½Õâ¸öÎÊÌ⣬Òò´Ë£¬ÔÚÆ¥Åä×Ö·û´®µÄʱºò£¬ÀÏÊDzéѯ²»µ½Ô¤ÆÚµÄÊý¾Ý¡£µ±ÎÒ×îÖÕ·¢ÏÖÕâ¸öÎÊÌâµÄʱºò£¬Ò²Ã»ÕÒµ½¸ÃÓÃʲô·ûºÅÀ´Æ¥Åä×Ö·û´®£¬×îºó£¬ÏëÁËÒ»¸öÀûÓÃ"%"À´Íê³É×Ö·û´®Æ¥ÅäµÄ·½·¨£º
    1¡¢ÉùÃ÷Ò»¸ö×Ö·û´®Æ¥ÅäµÄ±äÁ¿£¬³¤¶ÈΪÊý¾Ý¿âÖÐҪƥÅäÏ¶È+2£¬È磺TESTID-FILTERÈ«²¿´æ·Å"%"£»
    2¡¢½«´ÓÖն˻ñµÃµÄɸѡ×Ö·û´®,ÈçTESTID-INPUTÈ¥µô¿Õ¸ñºó£¬²åÈëµ½1Öж¨ÒåµÄ±äÁ¿µÄµÚ¶þλ£»
    3¡¢µÃµ½×Ö·û´®TESTID-FILTER¾ÍÊÇÓÃÔÚLIKEÖÐÆ¥Åä×Ö·û´®µÄËÞÖ÷±äÁ¿ÁË¡£
    Ò²¾ÍÊÇ˵£¬½«Öն˵õ½µÄÊý¾Ý±ä³ÉÐÎÈç"%*******%%%%%%%%%%"ÕâÑùµÄÆ¥Åä×Ö·û´®£¬ÓÃÓÚÊý¾Ý¿âµÄ²éѯ¡£ÕâÑù£¬¾Í¿ÉÒԳɹ¦µÄʵÏÖ²éѯÊý¾Ý¿âÖиÃÏî°üº¬"******"×Ö·û´®µÄËùÓÐÏî¡£


Ïà¹ØÎĵµ£º

SQL SERVER ÖÐÈçºÎʹÓÃÐÐËø

¸øÄã¸ö×îÏêϸµÄ°É ¿ÉÄÜÓÐÄãÒªµÄÄÚÈÝ
ËøµÄ¸ÅÊö
Ò». ΪʲôҪÒýÈëËø
¶à¸öÓû§Í¬Ê±¶ÔÊý¾Ý¿âµÄ²¢·¢²Ù×÷ʱ»á´øÀ´ÒÔÏÂÊý¾Ý²»Ò»ÖµÄÎÊÌâ:
¶ªÊ§¸üÐÂ
A,BÁ½¸öÓû§¶ÁͬһÊý¾Ý²¢½øÐÐÐÞ¸Ä,ÆäÖÐÒ»¸öÓû§µÄÐ޸Ľá¹ûÆÆ»µÁËÁíÒ»¸öÐ޸ĵĽá¹û,±ÈÈ綩Ʊϵͳ
Ôà¶Á
AÓû§ÐÞ¸ÄÁËÊý¾Ý,ËæºóBÓû§ÓÖ¶Á³ö¸ÃÊý¾Ý,µ«AÓû§ÒòΪijЩԭÒòÈ¡Ï ......

¸ßЧSQL²éѯ֮Ë÷Òý£¨VI£©

ÎÒÃÇÏÈ¿´ NestedLoop ºÍ MergeJoin µÄËã·¨£¨ÒÔÏÂΪÒýÓ㬼û RicCC µÄ¡¶ ͨÍùÐÔÄÜÓÅ»¯µÄÌìÌà - µØÓü JOIN ·½·¨ËµÃ÷ ¡· ):
==================================
NestedLoop:
   foreach rowA in tableA where tableA.col2=?
    {
    search rowsB from tableB where tableB.c ......

¸ßЧSQL²éѯ֮Ë÷Òý£¨III£©

ÏÈ˵˵ÕâЩÎóÇø¡£Ëùν“ÎóÇø”£¬ÓÐһЩÊÇÐÂÊÖºÜÈÝÒ×·¸µÄ´íÎó»òÕߺÜÈÝÒ׺öÂÔµÄÎÊÌ⣬ÁíÍâһЩ£¬ÔòÊÇÏñ“ºÄ×Ó³ÔÁËÑλá±ä³Éòùòð”Ò»Ñù£¬ÈÃÎÒÃÇ´ÓС¾ÍÈÏΪÊÇÕýÈ·µÄÊÂÇé¡£ÈçÏ£º
1¡¢   ±íÉϲ»¹ÜÓõÃ×ÅÓò»×Å£¬¶¼¼Ó¸ö¾Û¼¯Ë÷Òý¡£
ÎÒÃÇÖªµÀ£¬±íÒÔÁ½ÖÖ·½Ê½×éÖ¯ÎïÀí´æ´¢£ºÓоۼ¯Ë÷ÒýµÄ“¾Û¼¯± ......

ÀûÓÃͬÒå´Ê¼ò»¯SQL Server 2005¿ª·¢

Ò». ÒýÑÔ
¡¡¡¡Èç¹ûÄãÔø¾­Ê¹ÓÃSQL Server¿ª·¢¹ýÈκÎÈí¼þ£¬ÄÇôÄã¿Ï¶¨»áÏ°¹ßÓÚʹÓÃËIJ¿·Ö±êʶ·ûÀ´²Î¿¼Ò»¸ö¶ÔÏó£º
[[[server.][database].][schema_name].]object_name
¡¡¡¡ÕýÈçÉÏÃæµÄ·½À¨ºÅËùÏÔʾµÄ£¬¸ÃÓï·¨µÄ²»Í¬²¿·Ö¿ÉÒÔ±»ºöÂÔ£¬Ö»ÒªÄãÌṩ×ã¹»µÄ±í´ïÀ´ÎÞ¶þÒåµØ±êʶÄãµÄ¶ÔÏó¼´¿É¡£ÀýÈ磬ÏÂÃæËùÓÐÕâЩ±í´ï¶¼¿ÉÄܲο¼Ïàͬµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ