有没有一种方法可以编写不带 AND 运算符的连接 where 子句?

问题描述 投票:0回答:1

只是出于好奇,是否有一种简短/漂亮的方法可以编写经典的

sql where clauses
而无需使用 AND 运算符来连接表?

经典:

select * from table1, table2, table3 where table1.fkId=table2.id and table1.fkId=table3.id

如果有这样的东西那就太好了:

select * from table1, table2, table3 where table1.fkId=table2.id=table3.id

仅供参考,我大部分时间都在使用 Oracle 和 Ms-Sql 数据库。

sql sql-server oracle query-optimization ansi-sql
1个回答
0
投票

您可以使用 ALL 运算符进行相同操作

select * from table1, table2, table3 
where table1.fkId=ALL(table2.fid,tables3.fid..)
© www.soinside.com 2019 - 2024. All rights reserved.