diff --git a/posthog/hogql_queries/actors_query_runner.py b/posthog/hogql_queries/actors_query_runner.py index 93e9f40c70739..215c7ed183165 100644 --- a/posthog/hogql_queries/actors_query_runner.py +++ b/posthog/hogql_queries/actors_query_runner.py @@ -142,11 +142,11 @@ def source_table_join(self) -> ast.JoinExpr: source_alias = "source" return ast.JoinExpr( - table=ast.Field(chain=[self.strategy.origin]), + table=source_query, + alias=source_alias, next_join=ast.JoinExpr( - table=source_query, + table=ast.Field(chain=[self.strategy.origin]), join_type="INNER JOIN", - alias=source_alias, constraint=ast.JoinConstraint( expr=ast.CompareOperation( op=ast.CompareOperationOp.Eq,