常用且老记不住的几个ORACLE技巧
2012-01-10 08:35
489 查看
--设置sql到oracle的数据库连接
sp_addlinkedserver 'THSCMP','ORACLE','MSDAORA','THSCMP' ---THSCMP,CMP数据库名
sp_addlinkedsrvlogin 'THSCMP','FALSE',NULL,'HSCMP','HSCMP'
--闪回查询
select * from tabel_aa as of timestamp to_timestamp('2011-01-06 11:30:00', 'yyyy-mm-dd hh24:mi;ss')
--赋予权限
grant create any table to lsbh0826
Oracle创建序列
create sequence seq_a minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache;
查询序列
select seq_a.nextval from dual;
递归查询--这里递归的是组织编码
select orgcode from torgmanage where shorpgrade like pShopgrade start with orgcode=porgcode connect by prior orgcode=preorgcode
sp_addlinkedserver 'THSCMP','ORACLE','MSDAORA','THSCMP' ---THSCMP,CMP数据库名
sp_addlinkedsrvlogin 'THSCMP','FALSE',NULL,'HSCMP','HSCMP'
--闪回查询
select * from tabel_aa as of timestamp to_timestamp('2011-01-06 11:30:00', 'yyyy-mm-dd hh24:mi;ss')
--赋予权限
grant create any table to lsbh0826
Oracle创建序列
create sequence seq_a minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache;
查询序列
select seq_a.nextval from dual;
递归查询--这里递归的是组织编码
select orgcode from torgmanage where shorpgrade like pShopgrade start with orgcode=porgcode connect by prior orgcode=preorgcode
相关文章推荐
- Java数据库编程中的几个常用技巧
- Oracle常用的几个父栓
- [导入]Oracle常用技巧和脚本
- Oracle一些常用技巧
- Oracle 常用技巧和脚本
- oracle存储过程常用技巧
- oracle pl/sql脚本常用技巧
- 【转】oracle存储过程常用技巧
- Java数据库编程中的几个常用技巧
- Oracle sql plus中常用的几个命令
- 不可不知的Oracle常用技巧
- Java数据库编程中的几个常用技巧
- Oracle几个常用语法[不断补充]
- Java数据库编程中的几个常用技巧
- *Linux Shell 高级编程技巧4----几个常用的shell脚本例子
- Java数据库编程中的几个常用技巧
- [导入]Oracle 常用技巧和脚本
- oracle 数据库几个技巧
- Windows7常用的几个小技巧详细介绍
- oracle存储过程常用技巧