¶ÔÁ½¸öORACLEÊý¾Ý¿â²Ù×÷
Ê×ÏÈÉùÃ÷:·Çͬһ·þÎñÆ÷,ÇÐÊý¾Ý¿â²»ÄÜ×öÈκθü¸Ä!
´úÂë:
Delphi(Pascal) code:
DataSe := TADOQuery.Create(self);
DataSe.ConnectionString:='Provider=OraOLEDB.Oracle.1;Password=pass;Persist Security Info=True;User ID=db;Data Source=oracle1';
DataSe.SQL.Clear;
DataSe.SQL.Add('select count(t.id) as sj from table1 t where t.id in (select c.id from table2 c where c.typeid = ''9'') and t.time between to_date('''+DateTimeToStr(DateTimePicker1.DateTime)+''',''yyyy-mm-dd hh24:mi:ss'') and to_date('''+DateTimeToStr(DateTimePicker2.DateTime)+''',''yyyy-mm-dd hh24:mi:ss'') and t.memo like ''%ÉîÛÚ%''');
DataSe.Open;
Edit1.Text := DataSe.FieldByName('sj').AsString;
DataSe.Free;
ÉϱߴúÂëÔÚͬһ¸öÊý¾Ý¿âÖв»Í¬±í,¿ÉÒÔÕý³£Í³¼ÆÊý¾Ý.
ÎÊÌâ:
ÏÖÔÚÔÚÁíÒ»¸öÊý¾Ý¿âÖÐͳ¼ÆÊý¾Ý,ͬÑùÐèÒª Delphi(Pascal) code:
t.id in (select c.id from table2 c where c.typeid = ''9'')
Ìõ¼þ
ÁíÒ»¸öÊý¾Ý¿âÅäÖÆÇý¶¯DataSe.ConnectionString:='Provider=OraOLEDB.Oracle.1;Password=word;Persist Security Info=True;User ID=db2;Data Source=oracle2';
ÔõôÑù²ÅÄÜÏñÉϱßÄÇÑù²éѯ³öͳ¼ÆÊý¾Ýѽ??
´ó¼Ò¶¼Ã»ÓÐÆð´²ÄذÉ?~~~ µÈ´ý~~
¿ç¿â²éѯͳ¼Æ¿ÉÒÔÔÚÒ»ÌõsqlÖÐʵÏÖ£¬ÐèÒª°ÑÁíÒ»¸ö¿âµÄÁ¬½ÓÐÅϢдµ½sqlÖ
Ïà¹ØÎÊ´ð£º
´ó¼ÒºÃ,ÎÒÏÖÔÚ°Ñoracle·þÎñÆ÷ÉÏÃæµÄÔʼÎļþ,ÏÂÔØµ½±¾»úÁË.ÎÒÏëÔÚ±¾»ú·ÃÎÊÊý¾Ý¿âÔõôÉèÖð¡.ÊDz»ÊÇÀàËÆ¿ÉÒÔ½¨Á¢Ò»¸öʲôÐéÄâ·þÎñÆ÷À´ÊµÏÖ.Çë´ó¼Ò³ö³öÖ÷Òâ
ÒýÓÃ
´ó¼ÒºÃ,ÎÒÏÖÔÚ°Ñoracle·þÎñÆ÷ÉÏÃæ ......
ÎÒÔÚ¿ª·¢µÄÕâ¸öÓ¦Óò¢·¢ÐԱȽϸߣ¬oracle¸üÐÂÊý¾ÝʱºòÈçºÎ´¦Àí²¢·¢´¦ÀíÄØ£¿¸÷λ´óÏÀ·¢±íºÃµÄ¹Ûµã°¡£¬ÔÚÏߵȴý£¡
oracleÊý¾Ý¸üÐÂʱ£¬»á×Ô¶¯Ä¬ÈÏÐÐËø¶¨£¬Â¥Ö÷²»Òª²ÙÐÄ£¬Oracle¶Ô²¢Ðд¦ÀíÒѾºÜ³ÉÊìÁË
ÒýÓÃ
oracle ......
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001'
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......
ÎÒÓÐÁ½¸ö±í£¨A±íºÍB±í£©£¬»ú¹¹ÍêÈ«Ïàͬ£ºA ±í½¨Á¢´¥·¢Æ÷
µ±insert into A(id,name) values('1','zhangsan'); ÎÒÖ»Ï뽫name=zhangsanµÄʱºò½«insertÓï¾ä²åÈëµ½B±íÖжøA±í²»Ö´ÐвÙ×÷Õâ¸ö´¥·¢Æ÷Ó¦¸ÃÔõôʵÏÖÄØ£¿
È磺 ......