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

ÇóSQLÓï¾äµÄд·¨

ÎÒÏÖÔÚÓÐ2¸ö±íTable1£¬Table2¡£¶ÔÓ¦µÄ×ֶΡ¢Êý¾ÝÈçÏ£º

Table1£ºprimary key(a1)
a1(char)      a2(int)
  a            10
  b            30

Table2£ºprimary key(b1)
b1(char)      b3(int)
  a            5
  c            40
  d            100

----------------------------------------------------------------------------------

ÎÒÏëҪʵÏÖµÄÊÇ£º¸ù¾ÝTable1µÄa1×ֶΣ¬µÃµ½a2»òÕßb2µÄÊý¾Ý¡£
Ò²¾ÍÊÇ˵£¬Èç¹ûTable2ÀïÃæb1×ֶκÍTable1ÀïµÄa1×Ö¶ÎÏàͬµÄ£¬ÄÇô¾ÍÓÃb2µÄÊý¾Ý¡£

ÀýÈ磺¸ù¾ÝÒÔÉϵÄÊý¾Ý£¬ÎÒÒªµÃµ½µÄÊÇ£º
a            5
b            30

----------------------------------------------------------------------------------
ÇëÎÊÕâ¸öSQLÓï¾äÓ¦¸ÃÔõôд£¿
¶Ô²»Æð£¬ÉÏÃæµÄTable2µÄ±í½á¹¹Ð´´íÁË£¬ÐÞ¸ÄÏÂ
Table2£ºprimary key(b1)
b1(char)      b2(int)
  a            5
  c            40
  d            100


--> ²âÊÔÊý¾Ý£º[Table1]
if object_id('[Table1]') is not null drop table [Table1]
c


Ïà¹ØÎÊ´ð£º

Á½¸öµ¼¹¹sql serverÊý¾Ý¿â,Êý¾Ýµ¼Èëµ¼³öÎÊÌâ

ÏÖÔÚÓÐÁ½¸öÒì¹¹µÄsql serverÊý¾Ý¿â,ÎÒÏ뽫µÚÒ»¸ö±íÖеÄÊý¾Ýµ¼Èëµ½µÚ¶þ¸ö±íÖÐ,×Ô¼ºÖ¸¶¨µ¼ÈëÊý¾ÝµÄ×Ö¶Î,ÈçºÎµ¼ÈëÊý¾ÝÄØ,´ó¼ÒÌÖÂÛÒ»ÏÂ?
dts¹¤¾ß

µ¼Èëµ¼³ö¹¤¾ß.

DD

¹þ¹þ£¬¹À¼ÆÕâλÊǵØQIOU¶¼Êܲ»Á˵Ä

Ö±½ÓÐ ......

¹ØÓÚgroup byµÄsqlÓï¾ä£¿

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

delphiÖÐexcelµ¼Èësql serverµÄÎÊÌâ¡£

'Select * into mytable from OpenDataSource(''Microsoft.JET.OLEDB.4.0'',''Data Source=f:\test.xls;Mode=Read;Extended Properties=Excel 5.0;Persist Security Info=False' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ