0

I have a field that returns

{"nextPONumber":"3","poReportFooter":"This is the footer text for a purchase order report"}

I want to pull just the

"This is the footer text for a purchase order report"

SELECT
  modulesetting.value AS footer_value
FROM modulesetting
WHERE modulesetting.key='purchasing'
4
  • Use the built-in JSON functions. Commented Mar 23, 2017 at 16:06
  • what is the name of the field?.. Commented Mar 23, 2017 at 16:06
  • the field is footer_value which returns {"nextPONumber":"3","poReportFooter":"This is the footer text for a purchase order report"} Commented Mar 23, 2017 at 16:07
  • then qry in my answer should work Commented Mar 23, 2017 at 16:08

2 Answers 2

1

Use the built-in JSON functionality:

select
    modulesetting.value::json->>'poReportFooter'
from
    modulesetting
WHERE modulesetting.key='purchasing';

More info on the built-in JSON functions.

Sign up to request clarification or add additional context in comments.

Comments

0

a wild guess:

SELECT
  modulesetting.value->>'poReportFooter' AS footer_value
FROM modulesetting
WHERE modulesetting.key='purchasing'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.