Home > Database > Mysql Tutorial > Oracle where语句中and,or,not的执行顺序

Oracle where语句中and,or,not的执行顺序

WBOY
Release: 2016-06-07 17:00:09
Original
2228 people have browsed it

Oracle where子句里面的and,or,not:1.a and b(顺序执行) (1)a,b同true则true, (2)a,b一false则false, [1]若a为

Oracle where语句中and,or,not的执行顺序

[日期:2011-04-07] 来源:Linux社区  作者:BOBO12082119 [字体:]

Oracle where子句里面的and,or,not:

1.a and b(顺序执行)

      (1)a,b同true则true,

      (2)a,b一false则false,

         [1]若a为false,就没有必要在进行后面的判断了,整个表达式必为false;

         [2]若a为true,则进行后面的判断,b为true则表达式为true,若b为false,则整个表达式为false;

2. a or b(顺序执行)

       (1)a,b一true则true

          [1]若a为true,就没必要在进行判断了,表达式为true;

          [2]若a为false,继续判断b,若b为false,表达式为false;若b为true,则表达式为true;

       (2)a,b同false则表达式返回false

          此情况下,a为false,然后b也为false;

3.not a(先执行a,在取反)

      取反

      a->true, not a->false;

      a->false, not a->true;

linux

Related labels:
or
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template