sqlÓï¾ä´íÎó - Delphi / Êý¾Ý¿âÏà¹Ø
¶¨Òå±äÁ¿s,sqlΪstringÀàÐÍ£¬sΪº¯Êý²ÎÊý£¬sql£º='select field1 from table1 where'+s;ÔËÐÐʱs¸³ÖµÎªid>7»òÕßid<7¡¢id=7,µ«ÊÇÔËÐÐʱ×ÜÊdzö´í£¬Çë¸÷λ°ïÎÒ¸Ä´í£¬¶àл£¡
showMessage(sql)Ï¿´¿´
sql£º='select field1 from table1 where '+s;
ÓпÉÄÜwhereºó±ßÒª¼Ó¸ö¿Õ¸ñ
Êǿոñ
¸Ðл2룬2Â¥Â鷳˵Ïêϸһµã£¬Äã˵µÄ¿Õ¸ñÊǺÍÂ¥ÉϵÄÒ»ÑùÂð
×Ö·û´®Á¬ÔÚÒ»ÆðÁË£¬ÔËÐÐʱSQLµÄÖµ='select field1 from table1 whereid>7'¡£ÒªÔÚwhereºóÃæ¼ÓÒ»¸ö¿Õ¸ñ×Ö·û£¬¾Í»á±ä³É£º'select field1 from table1 where id>7'£¬Æäʵ2¥˵µÃºÜÃ÷°×À²£¬×Ô¼ºµ÷ÊÔÏÂÂï
ÔΡ£¡£¡£ÊÇ1Â¥¡£¡£¡£sorry¡£¡£¡£
ȷʵÊÇÕâÑùµÄ
End_rbody_64695987//-->
¸Ã»Ø¸´ÓÚ2010-04-16 08:58:16±»¹ÜÀíԱɾ³ý
¶ÔÎÒÓÐÓÃ[0]
¶ª¸ö°åש[0]
ÒýÓÃ
¾Ù±¨
¹ÜÀí
TOP
cloudysoul
(cloudysoul)
µÈ¡¡¼¶£º
#8Â¥ µÃ·Ö£º10»Ø¸´ÓÚ£º2010-04-15 20:26:35
sql£º='select field1 from table1 where'+s
ÕâÑùд²»Ì«ºÃ°É
¸Ä³ÉÕâÑùÊÔÒ»ÊÔ£º
sql£º='select field1 from table1'£»
if (Ìõ¼þ) then
sql:=sql+'where id>7';
if (Ìõ¼þ) then
sql:=sql+'where id<7';
if (Ìõ¼þ) then
sql:=sql+'where id=7';
ÐÂÊֻشðÎÊÌ⣬¼ûЦÁË£¡
ÉÙÁ˸ö¿Õ¸ñ°É
showMessage(sql)Ï¿´¿´
Òª²»°Ñ´íÎóÌùÉÏÀ´£¡
ÔÎÓ´¡¢Ã»¿Õ¸ñŶ¡¢
Ó¦¸ÃÊÇÉÙ¿Õ¸ñ£¬ÎÒÒ²Óöµ½¹ýÀàËÆÇé¿ö¡¡
¿ÉÄÜÊǿոñµÄÔÒò£¬¸Ä³É
sql£º='select field1 from table1 where '+s
×îºÃÑø³Éϰ¹ß£¬ÔÚ×Ö·ûÏà¼Óǰ£¬¶¼Ô¤ÁôÏ¿ո
Ïà¹ØÎÊ´ð£º
ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º
......
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......
ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP
²Î¿¼:http://hi.baidu.com/toiota ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......
Àý×Ó³ÌÐò¼û¸½¼þ£¬ÓÃDelphi 7½øÐбàÒë
ÎÊÌâ´úÂëΪ
Delphi(Pascal) code:
if Node.ChildNodes <> nil then
begin
for i := 0 to Node.ChildNodes.Count - 1 do
begin
cNode := N ......