score:1

Accepted answer

You can use row_to_json and array_to_string in your query.

See below an example.

SELECT array_to_string(array( SELECT row_to_json(products.*) FROM products),', ') as jsonData;

Hope this will help!


Related Query