“AND ..和... and”和“and(and .. and)”之间的区别
16lz
2021-01-22
I have two statement sql for oracle 11gr2
我有两个用于oracle 11gr2的语句sql
sql1:
Select * from tableA inpt, tableB ptbs
where inpt.z='A'
AND (inpt.pid = ptbs.pid
AND inpt.instcd = ptbs.instcd);
sql2:
Select * from tableA inpt, tableB ptbs
where inpt.z='A'
AND inpt.pid = ptbs.pid
AND inpt.instcd = ptbs.instcd
Sql1 is faster than sql2?
Sql1比sql2快吗?
The writing ... and ... and ... and ...
Slowly write and (... and ... and (... and ... and ...))
?
写作......和......以及... ......慢慢地写和(......和......以及......(......和......))?
Similar to "or"?
类似于“或”?
2 个解决方案
#1
1
There is no difference here.
这里没有区别。
where inpt.z='A'
AND (inpt.pid = ptbs.pid
AND inpt.instcd = ptbs.instcd);
or
where inpt.z='A'
AND inpt.pid = ptbs.pid
AND inpt.instcd = ptbs.instcd
or
where inpt.pid = ptbs.pid
AND inpt.instcd = ptbs.instcd and inpt.z='A'
All is the same.
一切都是一样的。
更多相关文章
- sqlserver各种注释语句的写法
- 关于sql语句的多重循环
- 深度探索 -- 生成SQL语句的向导应如何做?
- SQL语句字符串
- SQL语句的优化
- 如何使用SQL语句查到当前SQL SERVER 2000服务器的IP地址
- Oracle 常用sql语句
- 求SQL语句,有没有周末上班的高手,给帮个忙吧!
- PL/SQL中在package里定义的常量与在package body中的常量有什么