sql中的a = b = c是什么意思?
What does a = b = c mean in sql?
我发现可以在 vertica SQL 中编写查询,您可以通过以下方式比较 3 个参数
select * from table1 a
join table2 b on ...
join table3 c on ...
where a.id = b.id = c.id
是否等于
select * from table1 a
join table2 b on ...
join table3 c on ...
where a.id = b.id and b.id = c.id
还是有不同的意思?
b.id = c.id
将首先计算,并等于 true
或 false
。
然后将其与 a.id
进行比较,后者可以是布尔值或等于 0 或 1 的数字。如果 a.id 是 0 或 1 以外的数字,则会出现错误。
话虽这么说,但我认为这不是您想要的行为:)
我发现可以在 vertica SQL 中编写查询,您可以通过以下方式比较 3 个参数
select * from table1 a
join table2 b on ...
join table3 c on ...
where a.id = b.id = c.id
是否等于
select * from table1 a
join table2 b on ...
join table3 c on ...
where a.id = b.id and b.id = c.id
还是有不同的意思?
b.id = c.id
将首先计算,并等于 true
或 false
。
然后将其与 a.id
进行比较,后者可以是布尔值或等于 0 或 1 的数字。如果 a.id 是 0 或 1 以外的数字,则会出现错误。
话虽这么说,但我认为这不是您想要的行为:)