Posts

Showing posts with the label sql

Read through all values in an array in PostgreSQL

Same applies to Greenplum: select col1,array1 from schema.table WHERE 'value_to_search_for'= ANY(array1); array1 is a column in the table with type name[] in this case

Greenplum update with multiple tables

Recently ran into an issue using Greenplum to update a column. I had column1 in tableA that needed to be set to the value of column1 in tableB. Finally came across the correct syntax here . This is what I was looking for: UPDATE tableA  SET col1 = tableB.col1  FROM tableB  WHERE tableA.col2=tableB.col2;