Jump to content
We've recently updated our Privacy Statement, available here ×

Postgres JSONB syntax


spam_24

Recommended Posts

I have a query. But the Datasource Selection doesnt work, it shows error with the syntax, since this is a valid SQL statement, is there a way to get this to work within jasper? or do I need to place a view between the report and the data? I can find any reference on this, so struggling a bit.

The SQL looks like this, 

SELECT
              (data #>>'{userId}')::int  AS userId,
               data->'updated_at' AS updated,
               data
 FROM
               balances
WHERE 
              (data #>>'{userId}')::int = 1 AND  data->>'asset' ='AEN'
 GROUP BY
              data
 ORDER BY
              updated DESC;
 

And generates the following.

1

"2020-02-03 14:44:29"{"asset": "AEN", "purge": "0", "userId": "1", "service": "main", "available": "4.0000003200000000", "updated_at": "2020-02-03 14:44:29"}
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...