`

oracle的between...and..

阅读更多

今天下午上班没事,就把oracle的sql手册找出来,一一做了一下,才发现对rang condition(范围条件),between..and..的理解一直是错误的,现简单地总结(都不好意思说,太简单了,但不注意可能会在生产环境中造成错误).

   1)sql中的conditions是在select,delete,update语句常常用到的,其中range condition只包含:(not)between..and.

  2)oracle的between..and..前后都是闭区间,也就是说包含两个端的数,例如:

SELECT * FROM employees
  WHERE salary
  BETWEEN 2000 AND 3000;
查询返回 2000<=工资<=3000的员工

    3)当前者数大于后者,如:salary between 100 and 10;此时不会出错,但salary为50的记录也不能被取出。

    4)not between..and..只是取指定范围的相反范围,也就是不在这个范围的记录,其用户可以用组个逻辑条件来取代。

分享到:
评论

相关推荐

    Expert Oracle GoldenGate.pdf

    GoldenGate supports homogeneous replication between Oracle databases. It supports heterogeneous replication involving other brands such as Microsoft SQL Server and IBM DB2 Universal Server. ...

    Oracle课件.pdf

    6.4 BETWEEN…AND… 6.5 LIKE模糊查询 6.6 集合运算 6.7 连接查询 第3章 子查询和常用函数 1. 子查询 2. Oracle中的伪列 2.1 ROWID 2.2 ROWNUM 3. Oracle单行函数 3.1字符函数 3.2数字函数 3.3日期函数...

    Oracle Database Transactions and Locking Revealed(Apress,2014).

    Oracle Database Transactions and Locking Revealed provides much-needed information for building scalable, high-concurrency applications and deploy them against the Oracle Database. Read this short, ...

    Oracle Database 12c RAC 体系结构

    – Oracle Clusterware enables nonclustered and RAC databases to use the Oracle high-availability infrastructure. – Oracle Clusterware enables you to create a clustered pool of storage to be used by ...

    英文原版-Linux and Solaris Recipes for Oracle DBAs 1st Edition

    Oracle Corporation has been working diligently to bring commonality between Solaris and and Linux, and this book takes advantage of those efforts to provide task-oriented solutions that work on ...

    ORACLE_SQL性能优化(这个很全的)

    ORACLE_SQL性能优化(这个很全的)

    Direct.Oracle.Access.4.13

    then the Direct Oracle Access component set can help you to make a seamless integration between this great development tool and database system. Not only will your application take maximum advantage ...

    Linux and Solaris Recipes for Oracle DBAs(Apress,2ed,2015)

    Oracle Corporation has been working diligently to bring commonality between Solaris and Linux, and this book takes advantage of those efforts to provide task-oriented solutions that work on common ...

    Expert Oracle GoldenGate

    GoldenGate supports homogeneous replication between Oracle databases. It supports heterogeneous replication involving other brands such as Microsoft SQL Server and IBM DB2 Universal Server. ...

    Oracle 11g For Dummies.pdf

    How to recognize and accommodate the differences between Oracle installations on Windows and on Linux/UNIX Daily and intermittent tasks necessary to keep your database running properly How to assess ...

    Practical Oracle Database Appliance 英文PDF扫描版

    Practical Oracle Database Appliance is a hands-on book taking you through the components and implementation of the Oracle Database Appliance. Learn about architecture, installation, configuration, and...

    英文原版-PeopleSoft for the Oracle DBA 2nd Edition

    PeopleSoft for the Oracle DBA, Second Edition stands on the boundary between the PeopleSoft application and the Oracle database. This new edition of David Kurtz‘s book is freshly revised, showing ...

    Replicating Transactions Between MS SQL Server and Oracle Database

    Replicating Transactions Between Microsoft SQL Server and Oracle Database Using Oracle GoldenGate

    Oracle正则表达式参考手册

    The book describes Oracle Database 10G's support for regular expressions, including globalization support and differences between Perl's syntax and the POSIX syntax supported by Oracle 10G....

    Geoserver用户手册

    4.4 Migrating a Data Directory between different versions . . . . . . . . . . . . . . . . . . . . . . 49 5 Web Administration Interface 53 5.1 Interface basics . . . . . . . . . . . . . . . . . . . . ...

    OO4O(Oracle Objects for OLE C++ Class Library)

    Oracle Objects for OLE (OO4O) is a product designed to allow easy access to data stored in Oracle databases using any programming or scripting language that supports the Microsoft COM Automation and ...

    spring-framework-reference4.1.4

    3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................

    对于 Oracle 的 rownum 问题

    对于 Oracle 的 rownum 问题,很多资料都说不支持&gt;,&gt;=,=,between...and,只能用以上符号(&lt;、、!=),并非说用&gt;,&gt;=,=,between..and 时会提示SQL语法错误,而是经常是查不出一条记录来,还会出现似乎是莫名其妙的结果来...

    Oracle Business Intelligence with Machine Learning : Artificial Intelligence

    The primary objective of this book is to bridge the gap between the academic state-of-the-art and the industry state-of-the-practice by introducing you to machine learning with OBIEE. What You Will ...

Global site tag (gtag.js) - Google Analytics