最近用的SQL语句

select * from pi_incident t
update pi_incident tt set tt.x=tt.shape.minx   将空间坐标赋值给X,Y
查找表字段  desc pi_onecall(表名)  新建command  window
删除 整个表内容  delete pi_onecall(表名)
desc pi_attachment
删除表  drop table pi_attachment1

给pi_attachment赋值OBJECTID
SQL> alter table pi_attachment add objectid INTEGER;
 
Table altered
 
SQL> update pi_attachment set objectid=objectid.nextval;
 
1943 rows updated
 
SQL> commit;

去除一列中的含空格的语句。

update pi_attachment tt set tt.attachrefid=RTRIM(tt.attachrefid,' ')
统计记录条数
select count(*) from er_attachment

 

select objectid from pi_attachment t order by t.objectid
update pi_attachment t set t.objectid=t.objectid-23500
select objectid.nextval  from dual

查找slopeid非空的值
select * from pi_incident t where slopeid is not null for update
更新记录,如果EVENTID能够对应,那么将DEVICEID赋值成1542f798266503820126653b86df00d3     

update cp_test_wharfanode set DEVICEID='1542f798266503820126653b86df00d3      '  where eventid='7aed1398513c4a659f5de50858ceec4e      ';

将表CP_ATTACHMENT记录插入到pi_attachment语句

insert into pi_attachment(attachid,attachreftype,attachrefid,attachtypeid,attachpartoftypeid,attachfilename,attachsuffixname,attachdescription,attachcreatedate,attachcreater,attachcontent,objectid) select t.attachid,t.attachreftype,t.attachrefid,t.attachtypeid,t.attachpartoftype,t.attachfilename,t.attachsuffixname,t.attachdescription,t.attachcreatedate,t.attachcreater,t.attachcontent,t.objectid from CP_ATTACHMENT t;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值