Oracle³£ÓÃÓï¾ä
--ÈçºÎÓÃgrade±íµÄ×ÊÁÏÈ¥¸üÐÂusertable±íµÄ×ÊÁÏ£¨ÓйØÁªµÄ×Ö¶Îuserid£©
update usertable u set u.grade =
(select g.grade from grade g where g.userid = u.userid);
--ÈçºÎʹ²éѯ½á¹û×Ö¶ÎÉú³ÉÐòºÅ
select rownum, t.* from sm_t_pad_new t
--ÈçºÎ¿ìËÙ×öÒ»¸öºÍÔ±íÒ»ÑùµÄ±¸·Ý±í
create table new_table as (select * from user);
--ÈçºÎ²é¿´Êý¾ÝÎļþµÄ´æ·Å·¾¶
select tablespace_name, file_id, bytes/1024/1024, file_name
from dba_data_files order by file_id;
--²éѯÐÕÃûÏàͬµÄÔ±¹¤µÄÐÅÏ¢
select u1.userid, u1.username from user u1,
(select username, count(*) from user group by username having count(username) > 1) u2
where u1.username = u2.username;
--¸ù¾Ýʱ¼ä²éѯ
select * from user
where create_time >= to_date('2010-4-16 00:00:00','YYYY-MM-DD HH24:mi:ss')
and create_time <= to_date('2010-4-16 12:00:00','YYYY-MM-DD HH24:mi:ss')
Ïà¹ØÎĵµ£º
Èý¡¢ PL/SQL³ÌÐòµ¥Ôª
1¡¢ÎÞÂÛÊǵ¥¶ÀµÄ¹ý³Ì/º¯Êý£¬»¹ÊÇ°üÖеĹý³Ì/º¯Êý£¬¶¼Í³³ÆΪ×Ó³ÌÐò¡£
2¡¢¹ý³Ì
1) Òì³£´¦Àí²¿·ÖÊÇ¿ÉÑ¡µÄ¡£
2) ¹ý³ÌÃûÓ¦¸ÃÓö¯´Ê£¬ÒòΪ¹ý³Ìͨ³£ÊÇÖ´ÐÐijÖÖ¶¯×÷¡£¹ý³Ì²¢²»Ò»¶¨¾ßÓвÎÊý¡£µ±´ ......
»ùÓÚOCI ʵÏÖµÄ ×î¸ßЧdump³ÌÐò£¬ ±ÈOTL ÒÔ¼°ÆäËûµÄ½Ó¿Ú¶¼¿ìºÜ¶à
ÄÜÖ´ÐÐÈκÎsql , ×Ô¶¯Ê¶±ð×Ö¶ÎÃûºÍ×Ö¶ÎÀàÐÍ£¬½øÐÐÊä³öÊä³ö
/*
* oracle_dump.cpp
*
* Created on: 2010-2-1
* Author: clm971910@gmail.com
*
* ѹËõ
* 4216351 dump done
* ÍêÕû 106 Ãë
* д·Ö¸ô·û 8Ãë
* ѹËõд´Å ......
±¾ÎĵµÊÇOracle
Database 11.2.0.1 for RHEL5 Server(°üÀ¨x86ºÍx86_64ƽ̨)µÄ¾²Ä¬°²×°Ö¸ÄÏ. ËùÓвÙ×÷ÎÞÐèʹÓÃͼÐνçÃæ. ¾²Ä¬°²×°ÄܼõÉÙ°²×°³ö´íµÄ¿ÉÄÜÐÔ, Ò²ÄÜ´ó´ó¼Ó¿ì°²×°ËÙ¶È.
# ºó¸úÃüÁî±íʾÒÔ²Ù×÷ϵͳÏÂrootÓû§²Ù×÷; ºó¸úÃüÁî±íʾÒÔ²Ù×÷ϵͳÏÂoracleÓû§²Ù×÷;
1.1 ÉÏ´«Èí¼þ
¼ÙÈç·ÅÔÚ/wangnc/oracle/11g/Ä ......
ÊäÈë²ÎÊý£ºstr ——Òª½ØÈ¡µÄ×Ö·û´®, ch——Òª²éÕÒµÄ×Ö·û´®
½ØÈ¡ch֮ǰ£¨²»°üÀ¨ch£©µÄ×Ö·û´®£º substr(str, 0, instr(str, ch) - 1)
½ØÈ¡chÖ®ºó£¨²»°üÀ¨ch£©µÄ×Ö·û´®£º substr(str, , instr(str, ch) + 1, length(str)) ......