码迷,mamicode.com
首页 > 数据库 > 详细

个人笔记-oracle

时间:2015-01-27 18:24:39      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:oracle


序列

select * from user_sequences 
select last_number from user_sequences where sequence_name='T_JGXX_POLY_SEQ';
alter sequence T_JGXX_POLY_SEQ increment by 1;
SELECT T_JGXX_POLY_SEQ.NEXTVAL FROM DUAL;


Meger

merge into t_jgxx_poly jg
using t_jgxx_poly_view v
on (jg.id=v.id and v.geometry is not null)
WHEN MATCHED THEN  
update set jg.geometry = v.geometry
WHEN NOT MATCHED THEN   
INSERT  (id,geometry) values(v.id,v.geometry)


view

create or replace view t_jgxx_poly_view as
select xz.geometry,jg.id from t_jgxx jg, XZQH_CNTY_POLY xz where jg.xzqh=xz.cnty_code and xz.geometry is not null
union all
select xz.geometry,jg.id from t_jgxx jg, XZQH_PREF_POLY xz where jg.xzqh=TO_CHAR(xz.PREF_CODE) and xz.geometry is not null
union all
select xz.geometry,jg.id from t_jgxx jg, XZQH_PROVINCE_POLY xz where jg.xzqh=TO_CHAR(xz.PROV_CODE) and xz.geometry is not null;


个人笔记-oracle

标签:oracle

原文地址:http://blog.csdn.net/ztt_1119/article/details/43197615

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!