oracleº¯ÊýʾÀý£¨×ªÔØ£©
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
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 name,length(name),addr,length(addr),sal,length(to_char(sal)) from gao.nchar_tst;
NAME LENGTH(NAME) ADDR LENGTH(ADDR) SAL LENGTH(TO_CHAR(SAL))
------ ------------ ---------------- ------------ --------- --------------------
¸ßǬ¾º 3 ±±¾©Êк£¶§Çø 6 9999.99  
Ïà¹ØÎĵµ£º
±¾ÎÄͨ¹ý¶ÔOracleÊý¾Ý¿âËø»úÖƵÄÑо¿£¬Ê×ÏȽéÉÜÁËOracleÊý¾Ý¿âËøµÄÖÖÀ࣬²¢ÃèÊöÁËʵ¼ÊÓ¦ÓÃÖÐÓöµ½µÄÓëËøÏà¹ØµÄÒì³£Çé¿ö£¬Ìرð¶Ô¾³£Óöµ½µÄÓÉÓڵȴýËø¶øʹÊÂÎñ±»¹ÒÆðµÄÎÊÌâ½øÐÐÁ˶¨Î»¼°½â¾ö£¬²¢¶ÔËÀËøÕâÒ»±È½ÏÑÏÖصÄÏÖÏó£¬Ìá³öÁËÏàÓ¦µÄ½â¾ö·½·¨ºÍ¾ßÌåµÄ·ÖÎö¹ý³Ì¡£
Êý¾Ý¿âÊÇÒ»¸ö¶àÓû§Ê¹ÓõĹ ......
ÓеÄÇé¿öÏ£¬ÎÒÃÇÐèÒªÓõݹéµÄ·½·¨ÕûÀíÊý¾Ý£¬Õâ²Å³ÌÐòÖкÜÈÝÒ××öµ½£¬µ«ÊÇÔÚÊý¾Ý¿âÖУ¬ÓÃSQLÓï¾äÔõôʵÏÖ£¿ÏÂÃæÎÒÒÔ×îµäÐ͵ÄÊ÷ÐνṹÀ´ËµÃ÷ÏÂÈçºÎÔÚOracleʹÓõݹé²éѯ¡£
ΪÁË˵Ã÷·½±ã£¬´´½¨Ò»ÕÅÊý¾Ý¿â±í£¬ÓÃÓÚ´æ´¢Ò»¸ö¼òµ¥µÄÊ÷Ðνṹ
Sql´úÂë
create table TEST_TREE
( &n ......
Access¡¢SQLServer¡¢Oracle³£¼ûSQLÓï¾äÓ¦ÓÃÇø±ð
¹Ø¾¢ËÉ PMP
Èç¹ûÒª¼æÈÝAccess¡¢SQL Server¡¢OracleÈý¸öÊý¾Ý¿â°æ±¾£»ÎÒÃÇÔÚ±àдSQLÓï¾äµÄ¹ý³ÌÖУ¬¾¡Á¿Ê¹ÓÃһЩͨÓõÄÓï¾ä£¬µ«»¹ÊÇÓÐЩ·½ÃæÓÐЩÇø±ð±ÜÃâ²»ÁË£¬ÏÖ¼òµ¥×ܽáһϡ£
ÒÔÏÂA´ú±íAccess,S´ú±íSQL Server,O´ú±íOracle
1¡¢È¡µ±Ç°ÏµÍ³Ê±¼ä
A:Select Now()
S:Selec ......
OracleÊý¾Ýµ¼Èëµ¼³öimp/exp
u
¹¦ÄÜ£ºOracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓëoracleÊý¾Ý»¹ÔÓ뱸·Ý¡£
´ó¶àÇé¿ö¶¼¿ÉÒÔÓÃOracleÊý¾Ýµ¼Èëµ¼³öÍê³ÉÊý¾ÝµÄ±¸·ÝºÍ»¹Ô£¨²»»áÔì³ÉÊý¾ÝµÄ¶ªÊ§£©¡£ OracleÓиöºÃ´¦£¬ËäÈ»ÄãµÄµçÄÔ²»ÊÇ·þÎñÆ÷£¬µ«ÊÇÄã×°ÁËoracle¿Í»§¶Ë£¬²¢½¨Á¢ÁËÁ¬½Ó ......
--==================================== Ò».sqlÓï¾ä·½Ãæ ====================================================
--========================================================================================================
1.Ôö¼ÓÖ÷¼ü
alter table TABLE_NAME add constraint KEY_NAME primary key ......