数据库常用语句

1.同义词语句

-- Create the synonym
create or replace synonym MASA_USER
  for BICP.MASA_USER;
 
2.oracle级联

--递归查询
select t.catalog_id
                  from t_resource_catalog t
                 start with t.parent_id in('05a4cdffcad34be4b59de32507fdc775','b77a14ddbcdb45f78e30a2893643a2bc')
                connect by prior t.catalog_id = t.parent_id;

3.oracle,db2表备份
Oracle:create table a  as select * from tableName;
DB2: create table a like tableName 或create table a as(select * from hh_app.a) definition only in tbs_hh;

猜你喜欢

转载自apple-wuhongyan.iteye.com/blog/1882455