zoukankan      html  css  js  c++  java
  • oracl(三)算术操作符

    Oracle中算术操作符(+)(-)(*)(/) 值得注意的是:/ 在oracle中就相当于显示中的除法 5/2 = 2.5

    比较操作符:

        其中等号可以换成其他运算符:(后面为该操作符的单条件查询样例)

      
        != 不等于 select empno,ename,job from scott.emp where job!='manager'

        ^= 不等于 select empno,ename,job from scott.emp where job^='manager'

        <>不等于  select empno,ename,job from scott.emp where job<>'manager'

        <小于  select sal from scott.emp where sal<1000

        >大于 select sal from scott.emp where sal>1000

        <=小于等于 select sal from scott.emp where sal<=1000

        >=大于等于  select sal from scott.emp where sal>=1000

        in 在列表  select sal from scott.emp where sal in(1000,2000)
        时间的查询可以使用in 例如  select * from student where time in (’06-3月-09’,’08-5月-09’); 

        not in 不在列表 select sal from scott.emp where sal not in(1000,2000)

        between...and 介于..与..间 

                       select sal from scott.emp where sal  between 1000 and 2000


        not between...and 不介于..与..之间  

                       select sal from scott.emp where sal not between 1000 and 2000

        like 模式匹配  select ename from scott.emp where ename like 'M%' (%表示任意长度的长度串)
                       select ename from scott.emp where ename like 'M_' (_表示一个任意的字符)


        is null 是否为空  select ename from scott.emp where ename is null

        is not null 不为空 select ename from scott.emp where ename is not null

    逻辑操作符:

        or(或)  select ename from scott.emp where ename='joke' or ename='jacky'

        and(与) select ename from scott.emp where ename='and' or ename='jacky'

        not(非) select ename from scott.emp where not ename='and' or ename='jacky'
     
    集合操作符:

        union(并集)       union连接两句sql语句, 两句sql语句的和 去掉重复的记录。

                            (select deptno from scott.emp) union (select deptno from scott.dept)

        union all(并集)   接两句sql语句,两句sql语句的和不用去掉重复的记录。 

                            (select deptno from scott.emp) union all (select deptno from scott.dept)

        intersect (交集)  Intersect连接两句sql语句 取查询出来的两个集合的 共同部分。

                            (select deptno from scott.emp) intersect (select deptno from scott.dept) 

        minus (补集)      Minus 连接两句sql 语句,取查询出来的两个集合的差。
                            (select deptno from scott.emp) minus (select deptno from scott.dept)

  • 相关阅读:
    vlc代码分析(3)——输入模块
    vlc学习计划(4)在EMACS中使用GDB调试
    There Are Free RTSP DirectShow Source Filters with full source code
    HDU 4283 You Are the One 第37届ACM/ICPC 天津赛区网络赛 1006题 (DP)
    HDU 4276 The Ghost Blows Light 第37届ACM/ICPC长春赛区1010题 (树形DP)
    POJ 1459 Power Network 最大流 dinic模板
    HDU 4273 Rescue 第37届ACM/ICPC 长春赛区网络赛1007题(三维凸包+重心+点面距离)
    HDU 4286 Data Handler 第37届ACM/ICPC 天津赛区网络赛1009题 (双向链表模拟)
    POJ 2246 ZOJ 1094 Matrix Chain Multiplication(简单题)
    HDU 4280 Island Transport 第37届ACM/ICPC 天津网络赛1003题 (最大流模板题,高效SAP模板)
  • 原文地址:https://www.cnblogs.com/wy0119/p/8111027.html
Copyright © 2011-2022 走看看