delphi×î»ù´¡µÄSQL²éѯ - Delphi / Êý¾Ý¿âÏà¹Ø
ÎÒÒª²éѯX±íÖÐ ÊÕÈë = YµÄ ×Ö¶Î
±ÈÈç ÎÒÔÚSQLÖÐ ÊÇÕâôÊäÈëµÄ slect * from X where ÊÕÈë = y
ÔÚdelphi ÖÐ y ¾ÍÓÃedit1.textÀïÊäÈë
begin
adoquery1.Close;
ADOQuery1.SQL.Clear;
adoquery1.SQL.Add('select * from xmb where ÊÕÈë='+''''+trim(edit1.Text)+'''');
try
adoquery1.open;
except
showmessage('ûÓиÃÊÕÈë¼Ç¼');
exit;
end;
Õâ¶Î¶ÏÂëµÄ»°£¬Èç¹ûÊÕÈëÎı¾µÄ¿ÉÒÔÖ´ÐÐ £¬µ«Èç¹ûÊÕÈëÊÇÊýÖµµÄ Ó¦¸ÃÔõôÐ޸ĴúÂ룡
Çë¸÷λ´óϺָ½Ì£¡
×¢Ò⣺ÊÕÈë×Ö¶ÎÊÇÊý×ÖÐÍ
ºÃ½áÕÊÁË
½¨ÒéÕâôд£º
adoquery1.SQL.Add('select * from xmb where ÊÕÈë:= earn')
adoquery1.Parameters.ParamValues['earn'] := trim(edit1.Text);
ͬÒâ3Â¥µÄ
delphiµ±Ê±¿ÎÉ趼ûÔõô×ö£¬°¥¡£¡£¡£
À´½áÕËÁË
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
¿ÉÄÜÒòΪ¹¤×÷µÄÔÒò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......
¾ßÌåÒªÇóÓ뱨³êQQ729851670
771234717
¡°Æ´Òô±à³Ì¡±ÊÇʲôÒâ˼
ÒýÓÃ
¡°Æ´Òô±à³Ì¡±ÊÇʲôÒâ˼
1.¸øÒ»¸ö×Ö¿ÉÒÔÏÔʾƴÒô£¬¶àÒô×ֵϰÄÜÏÔʾ¶ÔÓ¦µÄ¶à¸öÆ´Òô
2.¶Ô°üº¬¶àÒô×ֵĴÊÓïÖÇÄÜʶ±ð¸ø³öÆ´Òô¡£
3.¶ÔÒ»¶Î ......