79690514

Date: 2025-07-04 17:28:06
Score: 1.5
Natty:
Report link

Short answer: Yes.
Medium answer: Just because you can doesn't mean you should.
Long answer: There might be use-case for this?

See: https://dbfiddle.uk/8dBcdID7

METHOD:

  1. Data element is a structured type that's conducive to loop (comma-delim string, ARRAY[], JSON ARRAY{}, etc. )

  2. Use correlated in-line subquery (in the SELECT clause)

    1. Nest inner query: WITH RECURSIVE ... () CTE inside that sub-select

      1. Use correlated/lateral JOIN to main query to fetch current row

      2. Loop thru the recursive CTE positions in the array

    2. Return result to outer subquery

  3. Return result to main query

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: L. Rodgers