Skip to content

Commit

Permalink
WIP - fix .exists clause
Browse files Browse the repository at this point in the history
  • Loading branch information
luciano-fiandesio committed Jan 6, 2025
1 parent 6937fb2 commit aa533b4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,11 @@ protected String getColumnWithCte(QueryItem item, String suffix, CTEContext cteC
if (cteDef.isRowContext()) {
// Add additional status and exists columns for row context
columns.add(
"(%s.%s IS NOT NULL) as %s"
"COALESCE(%s.rn = %s, false) as %s"
.formatted(
cteDef.getAlias(programStageOffset), quote(colName), quote(alias + ".exists")));
cteDef.getAlias(programStageOffset),
programStageOffset + 1,
quote(alias + ".exists")));
columns.add(
"%s.eventstatus as %s"
.formatted(cteDef.getAlias(programStageOffset), quote(alias + ".status")));
Expand Down

0 comments on commit aa533b4

Please sign in to comment.