当前位置:Gxlcms > mysql > Oraclewhere语句中and,or,not的执行顺序

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

时间:2021-07-01 10:21:17 帮助过:29人阅读

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

人气教程排行