Skip to content

Tag: sql

Output array type column

I have a table like so – How do I output this result – Answer For an array, you would use array_agg(): If you want the value as a comma-sseparated string:

How to iteratively use INSERT INTO in PostgreSQL

I have Table1 with rows I want to iterate over, and insert values from those rows of data into another table. So basically pseudo is: Just looping through Table1, adding in one of its values every time. Answer I think you just want an INSERT INTO … SELECT here: Most SQL operations are inherently set bas…