79498083

Date: 2025-03-10 13:13:16
Score: 0.5
Natty:
Report link

unnest with ORDINALITY and ORDER BY, will still NOT preserve order. If any elements are null, they will get pushed to the bottom.

This method however WILL preserver order

ARRAY(
    SELECT v_users_basic[i].user_id
    FROM generate_subscripts(v_users_basic, 1) AS i
    ORDER BY i
)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Sachin