postgres insert select subquery code example Example: postgre insert select insert into TABLENAMEA (A,B,C,D) select A,B,C,D from TABLENAMEB