1

So I have table with "data" type JSONB column. I want do some calculations add/sub between values in the row. How I can do that?

   psql> select 2 + ("data"->'field') - ("data"->'anotherField') from js_data_table;

This one produces an syntax error [42601].

M_F
  • 406
  • 7
  • 16
  • There's no such thing as a `jsonp` data type. Do you mean `jsonb`? Also, show the *full, exact error text*. – Craig Ringer Sep 23 '15 at 23:58
  • Yep, exactly. And I think I've found the way select 2 + ("data"->'field')::NUMERIC in that case no error – M_F Sep 24 '15 at 09:31

0 Answers0