Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
it works Sir Adrian. Thanks!! >From psycopg2 documentation "*Never* use % or + to merge values into queries :" but in this scenario, I can use it, right? On Wed, May 9, 2018 at 12:21 PM, Adrian Klaver wrote: > On 05/08/2018 07:17 PM, tango

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread Adrian Klaver
On 05/08/2018 07:17 PM, tango ward wrote: Hi, Sorry for asking question again. I am trying to concatenate the value of column firstname and lastname from source DB to name column of destination DB. My code so far: cur_t.execute("""     SELECT firstname, lastname   

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
thanks for the ideas Sir. I haven't touched DB this deep before. Basically I need to migrate the data of a DB into a new complete system made in Django. The system architecture created in Django has big difference in terms of tables and columns than the data from source DB. Source DB doesn't have

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread David G. Johnston
On Tue, May 8, 2018 at 7:44 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, May 8, 2018 at 7:17 PM, tango ward wrote: > >> I am trying to concatenate the value of column firstname and lastname >> from source DB to name column of destination DB. >> >> for row in cur_t: >>

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread David G. Johnston
On Tue, May 8, 2018 at 7:17 PM, tango ward wrote: > I am trying to concatenate the value of column firstname and lastname from > source DB to name column of destination DB. > > (SELECT CONCAT(first_name, ',', last_name) AS > name FROM lib_author LIMIT 1) >

Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
Hi, Sorry for asking question again. I am trying to concatenate the value of column firstname and lastname from source DB to name column of destination DB. My code so far: cur_t.execute(""" SELECT firstname, lastname FROM authors; """) for row in