当前位置:首页 > 2014年信息技术考核数据库试题
select * from emp as of timestamp sysdate - interval '20' minute;
再如:恢复5 分钟之前的7369 号员工姓名
update emp e set ename = (select ename from emp as of timestamp systimestamp - interval '5' minute where empno=e.empno ) where empno=7369;
甚至可以查询及恢复被删除的表 select * from user_recyclebin;
flashback table 表 to before drop; 05. 正则表达式
ORACLE 在建表或查询时提供正则表达式支持: 例如:查询名字以S 作为开头字母的员工
select * from emp where regexp_like(ename ,'^S'); 例如:替换电话号码显示方式
select regexp_replace('123.321.1234', '([0-9]{3})\\.([0-9]{3})\\.([0-9]{4})', '(\\1) \\2-\\3') from dual;
例如:取得email 地址中的用户名
select regexp_substr('yihang@163.com', '^[^@]+') from dual; 例如:取得email 地址中的域名
select regexp_substr('yihang@163.com', '[^@]+$') from dual; 06. 如何加注释
建表时给表和列加注释是一个比较好的数据库编程习惯 例如:表加注释
comment on table 表 is '表注释'; 例如:列加注释
comment on column 表.列 is '列注释'; 例如:查表注释
select * from user_tab_comments where table_name = 表名; 例如:查列注释
select * from user_col_comments where table_name = 表名;
共分享92篇相关文档