6.在WHERE中使用between...and...
  用于区间值的条件判断(包含边界值)
 
  //查询工资在2000(包含)到3000(包含)之间的员工信息
  select empno,ename,sal
  from emp
  where sal>=2000 and sal<=3000;
  //采用between...and...实现
  select empno,ename,sal
  from emp
  where sal between 2000 and 3000;
 
  //查询2081年入职的,工资在2000和3000之间(包含)
  //的员工信息
  select empno,ename,sal
  from emp
  where to_char(hiredate,'yyyy')='2081'
    and sal between 2000 and 3000;
 
  //查询2081到2083年之间入职的员工信息
  select empno,ename,sal
  from emp
  where to_char(hiredate,'yyyy')>='2081'
    and to_char(hiredate,'yyyy')<='2083'

随机推荐

  1. jQuery选择器补充

    ---------------------------------------------------------------------------------------------------- ...

  2. javascript操作window对象

    document.defaultView或全局变量window--获取一个window对象. 1)获取窗体信息 innerHeight.innerWidth--获取窗体内容区域的高度.宽度. oute ...

  3. CC2540 与 CC2541 差别 1

    CC2540 的 1234 PIN 是 USB 功能,4 PIN 是 USB 的电压输入引脚. CC2541 没有 USB 功能.它的 1234 PIN 是 I2C 功能,为了与 CC2540 引脚兼 ...

  4. ACM-SG函数之Fibonacci again and again——hdu1848

    Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  5. SVN——Jenkins自动发布

    最近公司项目处于开发阶段,很多功能开发完后就需要发布到测试环境等待测试去验收,这个时候如果手动更新网站的话,是很费时费力的. 于是乎,我们做成了自动发布,这样我们只管提交代码到SVN就行了,发布由软件 ...

  6. spring mvc 项目 相关配置文件小结

    web.xml文件主要配置如下: 需要加载的配置文件: 类路径下,可以使用通配符配置  类似:classpath:conf/spring/*/*.xml, <context-param> ...

  7. genemotion

    genemotion 问题 https://blog.csdn.net/beiminglei/article/details/17399333 https://www.jianshu.com/p/f8 ...

  8. Oracle安装后命令行中运行sqlplus / as sysdba出现错误ora-01031:insufficient privileges

    Win10安装Oracle后命令行中运行sqlplus as sysdba出现错误ora-01031insufficient privileges的解决方法 情景描述 错误样例 错误分析 解决方法 情 ...

  9. GridBagLayout使用案例+获取目录下所有的文件+获取创建时间及最后修改时间

    package vvv; import java.awt.Dimension;import java.awt.GridBagConstraints;import java.awt.GridBagLay ...

  10. ASP版_阿里大于短信API Demo

    阿里大于申请地址:http://www.alidayu.com 阿里大于短信发送Demo: ******index.asp************* <%@LANGUAGE="VBSC ...