SDE数据存储说明

来源:互联网 发布:网络悬疑推理电视剧 编辑:程序博客网 时间:2024/05/22 10:32

以下说明主要为已注册版本后的数据存储

Arcgis SDE 中的存储为基表+A-D

基表为基本表,即原始表假设基表名为test
A表记录所有历史数据,命名为AID)表 ,如A22
D表记录删除的数据,命名为DID)表 ,如D22

基表和表,D表的关系,可以从注册表中查到 table_registry

select registration_ID from sde.table_registry
where table_name='test'

registration_ID就是对应的A表,D表的ID

基表的所有记录加上A表的在状态表中已完成的记录(即关联state_id字段,状态表states的closing_time字段不为空就是最终的结果,这样可以把中间的过程记录过滤掉
再减去D表中的记录就可以了

示例:
select registration_ID from sde.table_registry
where table_name='test'

得到 registration_ID=22

要查所有的记录就可以用下列语句查询

select objectid,testfield from sde.a22 where

(sde_state_id not
in (select sde_state_id from sde.d22) )
and sde_state_id inselect state_id from sde.states
where length(closing_time)>0
)

union
select objectid,testfield from SDE.test

原创粉丝点击