Re: [GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Patrick B
> > >> >> > > Please have a look on this example Patrick: http://sqlfiddle.com/#!15/ > 1773d/4 > > Lucas > > This helped a lot... it's working now :) Thanks guys!!! Patrick

Re: [GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Chris
On 16/09/16 08:07, Patrick B wrote: > > > A select can make up columns too, not just what you've got in a table, > so you can: > > select j_id, 'test-1 - comments' as comment from test2 where > customer_id=88897; > > and then you can simply insert that into your other table

Re: [GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Lucas Possamai
2016-09-16 10:07 GMT+12:00 Patrick B : > >> >> A select can make up columns too, not just what you've got in a table, >> so you can: >> >> select j_id, 'test-1 - comments' as comment from test2 where >> customer_id=88897; >> >> and then you can simply insert that into your other table (you don't >

Re: [GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Patrick B
> > > > A select can make up columns too, not just what you've got in a table, > so you can: > > select j_id, 'test-1 - comments' as comment from test2 where > customer_id=88897; > > and then you can simply insert that into your other table (you don't > need to specify the columns that are getting

Re: [GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Chris
On 16/09/16 07:45, Patrick B wrote: > Hi guys, > > > I got the test1 table with three columns: > > id(BIGINT) - j_id(BIGINT) - comments(CHARACTER VARYING) > > > *This needs to be done 180 times:* > > INSERT INTO test1 (id,j_id,comments) VALUES (default,123321,'test-1 > - comments'

[GENERAL] postgres insert + select + values - Pgsql 9.5

2016-09-15 Thread Patrick B
Hi guys, I got the test1 table with three columns: id(BIGINT) - j_id(BIGINT) - comments(CHARACTER VARYING) *This needs to be done 180 times:* > INSERT INTO test1 (id,j_id,comments) VALUES (default,123321,'test-1 - > comments'); > INSERT INTO test1 (id,j_id,comments) VALUES (default,123322,'te