Skip to content

A Quick Report's correlated subquery using `FETCH FIRST 1 ROWS ONLY` (meant to pull just the first matching supply order per part) only returns one row for the entire report instead of one qualifying row per part, even though multiple parts clearly have their own qualifying records. What typically causes this?

Answer

Check whether the view referenced inside the correlated subquery is actually scoped/correlated per outer row, or whether it's a single-record temporary/staging view populated by a specific screen (which would only ever contain one part's data regardless of how the subquery's WHERE clause is written) — using such a view inside what's meant to be a per-row correlated subquery collapses the result down to that one record for the whole report. Switching the subquery to reference the equivalent general, fully-correlated source view (with data spanning every part, not just one screen's current context) rather than a screen-specific temp view resolves this.

← Browse Reporting and analytics questions