You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The semantics of t1 group by a1 is to split the table t1 into the intermediate tables [{a1:1, b1:1}, {a1:1, b1:2}], [{a1:2, b1:3}], and [{a1:3, b1:1}, {a1:3, b1:2}, {a1:3, b1:3}]. The expression select a2 from t2 group by a2 having sum(1+0*b1) = 2 is thus executed three times in three different contexts.
The expression t2 group by a2 always creates the table [{a2:7, b2:7}, {a2:7, b2:8}] and
the condition having sum(1+0*b1) = 2 tests if the number of occurrences of b1 is two on each intermediate tables created by the first part of the query. This condition is true only on [{a1:1, b1:1}, {a1:1, b1:2}]. So the expected final result is [{a1:1}].
The text was updated successfully, but these errors were encountered:
The following example should return
[{a1:1}]
but returns[]
.See: https://jsfiddle.net/Ltpxzgqh/1/
The semantics of
t1 group by a1
is to split the tablet1
into the intermediate tables[{a1:1, b1:1}, {a1:1, b1:2}]
,[{a1:2, b1:3}]
, and[{a1:3, b1:1}, {a1:3, b1:2}, {a1:3, b1:3}]
. The expressionselect a2 from t2 group by a2 having sum(1+0*b1) = 2
is thus executed three times in three different contexts.The expression
t2 group by a2
always creates the table[{a2:7, b2:7}, {a2:7, b2:8}]
andthe condition
having sum(1+0*b1) = 2
tests if the number of occurrences ofb1
is two on each intermediate tables created by the first part of the query. This condition is true only on[{a1:1, b1:1}, {a1:1, b1:2}]
. So the expected final result is[{a1:1}]
.The text was updated successfully, but these errors were encountered: