小于博客 小于博客
首页
  • Java学习笔记
  • Docker专区
  • 实战教程
  • Shell
  • 内存数据库
  • Vue学习笔记
  • Nginx
  • Php
  • CentOS
  • Docker
  • Gitlab
  • GitHub
  • MySql
  • MongoDB
  • OpenVPN
  • 配置文件详解
  • Other
  • ELK
  • K8S
  • Nexus
  • Jenkins
  • 随写编年
  • 电影音乐
  • 效率工具
  • 博客相关
  • 最佳实践
  • 迎刃而解
  • 学习周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • 网站状态 (opens new window)
    • json2go (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)

小于博客

行者常至,为者常成
首页
  • Java学习笔记
  • Docker专区
  • 实战教程
  • Shell
  • 内存数据库
  • Vue学习笔记
  • Nginx
  • Php
  • CentOS
  • Docker
  • Gitlab
  • GitHub
  • MySql
  • MongoDB
  • OpenVPN
  • 配置文件详解
  • Other
  • ELK
  • K8S
  • Nexus
  • Jenkins
  • 随写编年
  • 电影音乐
  • 效率工具
  • 博客相关
  • 最佳实践
  • 迎刃而解
  • 学习周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • 网站状态 (opens new window)
    • json2go (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)
  • Java学习笔记

  • Docker专区

  • Shell编程

  • 实战教程

    • git教程

    • idea教程

    • linux教程

    • markdown教程

    • maven教程

    • 数据库部分

      • 数据库代码汇总
        • 1.oracle序列设置
        • 2.设置oracle外键关联
        • 3.设置新的最大连接数
        • 4.结束当前进程
        • 5.查看当前所有用户的连接
        • 6.我们来查看mysql的最大连接数
        • 7.查看序列下一个号码
        • 8.查询统计档案查询SQL语句
        • 9.如果查询出来的是null则用0代替
      • 阿里巴巴开源 Chat2DB v1.0.11 初体验
    • 电脑操作

  • 内存数据库

  • Vue学习笔记

  • 编程世界
  • 实战教程
  • 数据库部分
小于博客
2024-01-20
目录

数据库代码汇总

数据库代码汇总

# 1.oracle序列设置

create sequence SE_R_DOCUMENTDETAIL_1356
  minvalue 1
    nomaxvalue start with 1
      increment by 1
        noorder nocycle cache 20;
1
2
3
4
5

# 2.设置oracle外键关联

ALTER TABLE R_RECTIFICATIONSTAGE_1151 ADD CONSTRAINT SYS_C00110337 FOREIGN KEY(P_RECTIFICATIONSTAGEID) REFERENCES R_RECTIFICATIONSTAGE_1151(RECTIFICATIONSTAGEID);
1

# 3.设置新的最大连接数

set GLOBAL max_connections=200;

# 4.结束当前进程

kill 加进程ID

# 5.查看当前所有用户的连接

show full processlist;
1

# 6.我们来查看mysql的最大连接数

show variables like '%max_connections%';
1

# 7.查看序列下一个号码

select ACHILLES.SE_Q_CMN_OPPTAUDITDETAIL_558.nextval from dual
1

# 8.查询统计档案查询SQL语句

select opt20.operatepointid operatepointid,opt20.operatepointname operatepointname,opt20.OPERATEPOINTADDRESS OPERATEPOINTADDRESS,ind90.industrytypename industrytypename,
      un18.LEGALPERSON LEGALPERSON,opt20.OPPTRESPONSIBLEPERSON OPPTRESPONSIBLEPERSON,cmn1123.currentsupervisedptid currentsupervisedptid,
       opt20.opptresponsiblepersonphone opptresponsiblepersonphone,cmn1123.currentsuperviseopptid currentsuperviseopptid,
       replace(replace(opt21.operatepointname,'安全生产监察队',''),'浦东新区安全生产监察大队','安监大队') operatepointname1,opt20.longitude,opt20.latitude,cmn431.istemparchived,opt20.businessstatusid
       from q_cmn_operatepoint_20 opt20,d_industrytype_90 ind90,q_cmn_operatepoint_20 opt21,q_cmn_pandbunitsspecial_431 cmn431,
                       q_cmn_unit_18 un18,Q_CMN_OPTCURRENTSUPERVISE_1123 cmn1123
        where opt20.isdeleted=0
                      and cmn431.isdeleted = 0 and cmn431.ISNEEDREPORT=1 and cmn431.pandbunitsspecialid = cmn1123.pandbunitsspecialid
                      and cmn1123.CURRENTSUPERVISEYPE = 1 and cmn1123.isdeleted = 0 and opt20.operatepointid = cmn431.operatepointid and un18.isdeleted=0
                      --and opt20.businessstatusid between 1 and 2
                      and cmn1123.currentsuperviseopptid=opt21.operatepointid and opt20.industrytypeid=ind90.industrytypeid and opt20.unitid=un18.unitid;
1
2
3
4
5
6
7
8
9
10
11

# 9.如果查询出来的是null则用0代替

NVL(A.VERIFYNODEID, 0) VERIFYNODEID

上次更新: 2024/02/03, 13:17:04

← JAVA 如何上传自己的jar包到Maven中央仓库 阿里巴巴开源 Chat2DB v1.0.11 初体验→

最近更新
01
SpringBoot 快速实现 api 加密!
03-21
02
SpringBoot整合SQLite
03-07
03
SpringBoot配置使用H2数据库的简单教程
02-21
更多文章>
Theme by Vdoing | Copyright © 2017-2024 | 点击查看十年之约 | 豫ICP备2022014539号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式