From bc3cecec098da02fce4cde00e2bc0a86be62bbea Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 19 Oct 2017 09:25:07 -0400 Subject: [PATCH] add order by clause --- transaction_range.pgsql | 3 +++ 1 file changed, 3 insertions(+) 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