Answer the question
In order to leave comments, you need to log in
How to make a similar request if the field is text and not json?
Is it possible to write the same request if the raw field is not jsonb, but text?
SELECT
tp."raw"->>'errorCode' AS error_code,
count(tp."raw"->>'errorCode') AS "count"
FROM transaction_payment tp
WHERE (tp.date_created BETWEEN '2022-03-21 00: 00:00' AND '2022-03-27 23:59:59')
AND tp."raw" IS NOT NULL
AND tp."source" = 'mts-bpc'
GROUP BY tp."raw"->>' errorCode'
ORDER BY "count" DESC;
There is a mistake in the architecture, the request is needed for one-time statistics, so now rewrite it to the extreme only, since it is necessary to analyze the logic associated with this data. Maybe one of the gurus will tell you an option?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question