Home Concat two json fields in one column in POSTGRESQL 9.6
Reply: 0

Concat two json fields in one column in POSTGRESQL 9.6

user713
1#
user713 Published in May 27, 2018, 11:31 pm

Hello here is my query :

SELECT id,objecttype,(content->>'ip' || content->>'mask') as content,  FROM public."Route"

I'd like to concat these two json fields (ip,mask) but with a space betwen them. I tried to use concat function, it works but I don't have the space between.

This is the error generate from the query above :

ERROR:  operator does not exist: text ->> unknown
LINE 1: SELECT id,objecttype,(content->>'ip' || content->>'ip') as c...

The query works well with only one field, but I need two have the concatenation between these fields with a space between them.

Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.241111 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO