diff --git a/transaction_range.pgsql b/transaction_range.pgsql index b4f469e..c55a083 100644 --- a/transaction_range.pgsql +++ b/transaction_range.pgsql @@ -10,5 +10,8 @@ FROM s.srce = t.srce LEFT JOIN LATERAL JSONB_ARRAY_ELEMENTS_TEXT(defn->'unique_constraint'->'fields') WITH ORDINALITY ae(e, rn) ON TRUE GROUP BY + t.srce + ,(ae.e::text[])[1] +ORDER BY t.srce ,(ae.e::text[])[1] \ No newline at end of file