oracle常用查询
发布日期:2021-06-24 06:58:50 浏览次数:3 分类:技术文章

本文共 966 字,大约阅读时间需要 3 分钟。

查询某一列中重复数据

select username from xtgl_superusers group by username having count(username) >1

更新符合条件的人在后面加‘del’

update xtgl_superusers set username= CONCAT(username, 'del') where islock=1

ORACLE 如何按逗号截取查询所得的表名

SELECT   substr(T1.COMMENTS ,0,instr(T1.COMMENTS ,',',-1,1)-1)  as 列名  from  USER_TAB_COMMENTS  T1

select * from t where instr(','||sd_dept||',', ','||'一场'||',')>0 就是判断 是否包含一场的sql

 

截取字符串

update xtgl_superusers s set s.username=substr(s.username,1,instr(s.username ,'del',1,1)-1) where username like '%del%' and islock=0

根据pid查询循环一层一层的数据
select id from wggl_depart START WITH PID = 22825 CONNECT BY PRIOR ID = PID

更改所有aaa为bbb

update personnel t set t.url=replace(url,'aaa','bbb') where t.url is not null

查询在线人员列表

select * from superusers su where su.islock=0 and (su.onlinetime>sysdate-interval '65'second)

length使用

select id from depart d where length(d.sortall)=21 and d.islocf = 1 and d.state =1

 

转载于:https://www.cnblogs.com/lsy0811/archive/2012/11/15/2771023.html

转载地址:https://blog.csdn.net/weixin_30896763/article/details/98794269 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:第二次作业
下一篇:编译预处理命令define

发表评论

最新留言

很好
[***.229.124.182]2024年04月24日 12时38分09秒