From 7a406788dae2e823655403f8166a5917fafdd8c4 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 1 Mar 2018 17:23:07 -0500 Subject: [PATCH] include not on first getting ditinct list of item --- reports/all_map_return_values.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reports/all_map_return_values.sql b/reports/all_map_return_values.sql index 61270d8..1f802b3 100644 --- a/reports/all_map_return_values.sql +++ b/reports/all_map_return_values.sql @@ -1,4 +1,9 @@ -EXPLAIN +/* +first get distinct target json values +then apply regex +*/ + + WITH --------------------apply regex operations to transactions--------------------------------------------------------------------------------- @@ -92,11 +97,13 @@ WHERE e.v @> '{"map":"y"}'::jsonb --rec @> '{"Transaction":"ACH Credits","Transaction":"ACH Debits"}' --rec @> '{"Description":"CHECK 93013270 086129935"}'::jsonb +/* ORDER BY t.id DESC, m.target, e.rn, COALESCE(mt.rn,rp.rn,1) +*/ ) --SELECT * FROM rx LIMIT 100