只是出于好奇,是否有一种简短/漂亮的方法可以编写经典的
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 数据库。
您可以使用 ALL 运算符进行相同操作
select * from table1, table2, table3
where table1.fkId=ALL(table2.fid,tables3.fid..)