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

oracle º¯ÊýÕûÀí(Ò»)

1. ASCII: ·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii(0) zero,ascii('') space from dual; 
   A A ZERO SPACE
   --------- --------- --------- ---------
   65 97 48 
2. CHR:¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ×Ö·û;
SQL> select chr(54740) zhao,chr(65) chr65 from dual;
   ZH C
   -- -
   ÕÔ A
3. CONCAT:Á¬½ÓÁ½¸ö×Ö·û´®;
SQL> select concat('010-','88888888')||'ת23' ¸ßǬ¾ºµç»°  from dual;
   ¸ßǬ¾ºµç»°
   ----------------
   010-88888888ת23
   
4. INITCAP:·µ»Ø×Ö·û´®²¢½«×Ö·û´®µÄµÚÒ»¸ö×Öĸ±äΪ´óд;
SQL> select initcap('smith') upp from dual;
   UPP
   -----
   Smith
5.INSTR(C1,C2,I,J):ÔÚÒ»¸ö×Ö·û´®ÖÐËÑË÷Ö¸¶¨µÄ×Ö·û,·µ»Ø·¢ÏÖÖ¸¶¨µÄ×Ö·ûµÄλÖÃ;
          C1 ±»ËÑË÷µÄ×Ö·û´®
          C2 Ï£ÍûËÑË÷µÄ×Ö·û´®
          I ËÑË÷µÄ¿ªÊ¼Î»ÖÃ,ĬÈÏΪ1
          J ³öÏÖµÄλÖÃ,ĬÈÏΪ1
SQL> select instr('oracle traning','ra',1,2) instring from dual;
   INSTRING
   ---------
   9
6.LENGTH:·µ»Ø×Ö·û´®µÄ³¤¶È;
SQL> select length('smith') length from dual;
   length
   -----
   5
7.LOWER:·µ»Ø×Ö·û´®,²¢½«ËùÓеÄ×Ö·ûСд
SQL> select lower('AaBbCcDd')AaBbCcDd from dual;
   AABBCCDD
   --------
   aabbccdd
8.UPPER:·µ»Ø×Ö·û´®,²¢½«ËùÓеÄ×Ö·û´óд
SQL> select upper(AaBbCcDd) upper from dual;
   UPPER
   --------
   AABBCCDD
9.RPADºÍLPAD(Õ³Ìù×Ö·û):RPAD ÔÚÁеÄÓÒ±ßÕ³Ìù×Ö·û LPAD ÔÚÁеÄ×ó±ßÕ³Ìù×Ö·û
SQL> select lpad(rpad('gao',10,'*'


Ïà¹ØÎĵµ£º

oracle ±Ê¼Ç VIII Ö®ÊÂÎñºÍË÷Òý

 ÊÂÎñ¾ÍÊDZ»°ó¶¨ÔÚÒ»Æð×÷Ϊһ¸öÂß¼­¹¤×÷µ¥ÔªµÄSQLÓï¾ä·Ö×飬Èç¹ûÈκÎÒ»¸öÓï¾ä²Ù×÷ʧ°ÜÄÇôÕû¸ö²Ù×÷¾Í±»Ê§°Ü£¬ÒÔºó²Ù×÷¾Í»á»Ø¹öµ½²Ù×÷ǰ״̬£¬»òÕßÊÇÉÏÓиö½Úµã¡£ÎªÁËÈ·±£ÒªÃ´Ö´ÐУ¬ÒªÃ´²»Ö´ÐУ¬¾Í¿ÉÒÔʹÓÃÊÂÎñ¡£ÊÂÎñÓÐËĸöÌØÐÔ£¬·Ö±ðÊÇ£ºÔ­×ÓÐÔ£¬Ò»ÖÂÐÔ£¬¸ôÀëÐԺͳ־ÃÐÔ¡£
Ë÷Òý¾ÍÒ»ÖÖÌØÊâµÄ²éѯ±í£¬Êý¾Ý¿âµÄËÑË÷ÒýÇæ¿ ......

oracle ÊÓƵ±Ê¼Ç1(select)

ÏÂÃæÊÇÓÃscottÓû§²âÊԵġ£
Èç¹û²»ÖªµÀµ±Ç°Óû§ÊÇʲôÓû§,¿ÉÒÔÊäÈë: show user ,ÕâÑùËü¾ÍÏÔʾ³öµ±Ç°Óû§ÊÇʲôÓû§ÁË.
Èç¹ûÏë±à¼­ÒѾ­ÊäÈëµ½sqlplusÖеĴúÂë,¿ÉÒÔÊäÈë“ed”£¬È»ºó»Ø³µ¾ÍÄܵ¯³öÒ»¸ö¼Çʱ¾£¬¼Çʱ¾ÀïÃæÓÐÉÏÒ»²½ÊäÈëµÄ´úÂë,Ð޸ĴúÂë²¢±£´æºó¹Ø±Õ¼Çʱ¾,×îºóÔÚsqlplusÖÐÊäÈë“/”²¢»÷»Ø ......

ORACLE ROLLUPºÍCUBEµÄʹÓÃ

ROLLUP£¬ÊÇGROUP BY×Ó¾äµÄÒ»ÖÖÀ©Õ¹£¬¿ÉÒÔΪÿ¸ö·Ö×é·µ»ØС¼Æ¼Ç¼ÒÔ¼°ÎªËùÓзÖ×é·µ»Ø×ܼƼǼ¡£
CUBE£¬Ò²ÊÇGROUP BY×Ó¾äµÄÒ»ÖÖÀ©Õ¹£¬¿ÉÒÔ·µ»Øÿһ¸öÁÐ×éºÏµÄС¼Æ¼Ç¼£¬Í¬Ê±ÔÚĩβ¼ÓÉÏ×ܼƼǼ¡£
ÔÚÎÄÕµÄ×îºó¸½ÉÏÁËÏà¹Ø±íºÍ¼Ç¼´´½¨µÄ½Å±¾¡£
1¡¢ÏòROLLUP´«µÝÒ»ÁÐ
SQL> select division_id,sum(salary)
  2  ......

ORACLE GROUPING_IDº¯Êý

¿ÉÒÔʹÓÃGROUPING_IDº¯Êý½èÖúHAVING×Ó¾ä¶Ô¼Ç¼½øÐйýÂË£¬½«²»°üº¬Ð¡¼Æ»òÕß×ܼƵļǼ³ýÈ¥¡£GROUPING_ID()º¯Êý¿ÉÒÔ½ÓÊÜÒ»Áлò¶àÁУ¬·µ»ØGROUPINGλÏòÁ¿µÄÊ®½øÖÆÖµ¡£GROUPINGλÏòÁ¿µÄ¼ÆËã·½·¨Êǽ«°´ÕÕ˳Ðò¶ÔÿһÁе÷ÓÃGROUPINGº¯ÊýµÄ½á¹û×éºÏÆðÀ´¡£
¹ØÓÚGROUPINGº¯ÊýµÄʹÓ÷½·¨¿ÉÒԲμûÎÒÇ°ÃæдµÄһƪÎÄÕÂ
http://blog.csdn ......

PHPÁ¬½ÓOracle²¢·ÖÒ³·ÃÎÊ(OCI°æ)

ËäÈ»±¾ÈËûÓÐÑéÖ¤¹ý,²»¹ý¾Ý˵ͨ¹ýADODB·ÃÎÊOracle¶ÔÐÔÄÜÓ°ÏìºÜС.¶øÇÒADODB±ÈOCI8Ò²Òª·½±ãºÜ¶à,±Ï¾¹Ðí¶à¶«Î÷¶¼Ôٴηâ×°¹ý.²»¹ý²»¹ÜÔõô˵ÕⶼÔÚÖмäÓÖ¼ÓÉÏÁËÒ»²ã,ÀíÂÛÉÏÀ´Ëµ³öÏÖÎÊÌâµÄ¼¸Âʺͽâ¾öÎÊÌâµÄÄѶȶ¼±ä´óÁË.¶øOracleÓÖ¾­³£ÓÃÔÚ²»ÄÜËæ±ã³öÎÊÌâµÄ»·¾³,ËùÒÔÏë±ØÏëÒªÖ±½ÓʹÓÃOCIµÄÇé¿öÒ²²»ÉÙ.ÒÔϾÍÊÇÎÒµÄÀý×Ó:
<?p ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ