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 &nbs
Ïà¹ØÎĵµ£º
±íÀàÐÍ£º
1¶Ñ×éÖ¯±í£¨heap organized table£©£ºÕâЩ¾ÍÊÇ“ÆÕͨ”µÄ±ê×¼Êý¾Ý¿â±í¡£Êý¾ÝÒԶѵķ½Ê½¹ÜÀí¡£¶Ñ£¨heap£©ÊÇÒ»×é¿Õ¼ä£¬ÒÔÒ»ÖÖÓÐЩËæ»úµÄ·½Ê½Ê¹Óá£
2Ë÷Òý×éÖ¯±í£¨index organized table£©£ºÕâЩ±í°´Ë÷Òý½á¹¹´æ´¢¡£Õâ¾ÍÇ¿ÖÆÒªÇóÐб¾ÉíÓÐijÖÖÎïÀí˳Ðò¡£Ë÷Òý×éÖ¯±íIOTÖУ¬Êý¾ÝÒª¸ù¾ÝÖ÷¼üÓÐÐòµØ´æ´¢¡£
3Ë÷Ò ......
ORACLE 10 ѧϰ±Ê¼Ç-µÚ2½Ú-ÃüÁî¡£
1. inner join / left join/ right join / full join
select a.dname, b.ename from dept a, emp b where a.deptno=b.deptno and a.deptno=10;
select a.dname, b.ename from dept a inner join emp b
on a.deptno=b.deptno and a.deptno=10;
select dname,ename from dept natural ......
PL/SQL
¿é½á¹¹
DECLARE
ÉùÃ÷²¿·Ö
BEGIN
¿ÉÖ´Ðв¿·Ö
EXCEPTION
Òì³£´¦Àí²¿·Ö
END;
Àý£º
Ê×ÏÈÎÒÃÇ¿´Ò»¸ö¼òµ¥Ö®Àý×Ó,ÏÂÃæÕâ¸öÀý×ÓÊÇͳ¼Æ´Ó1 ......
IP µØÖ·×öÈçÏÂÐ޸ģº
Public IP 10.85.10.119/121 -- > 10.85.10.219/221
Privite IP 192.168.1.119/121 -- > 192.168.1.219/221
Virtual IP 10.85.10.122/123 -- ......
¹Ø¼ü×Ö: oracle cast() º¯ÊýÎÊÌâ
SQL> create table t1(a varchar(10));
Table created.
SQL> insert into t1 values ('12.3456');
1 row created.
SQL> select round(a) from t1;
ROUND(A)
----------
12
SQL> select round(a,3) from t1;
ROUN ......