Search Postgresql Archives

Re: Copying data from one table to another - how to specify fields?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 9, 2011, at 08:47 , Alexander Farber wrote:

> Hello,
> 
> I'm using CentOS 5.5 with PostgreSQL 8.4.7 and
> am migrating my site from phpBB 3 to Drupal 7.
> 
> I would like to copy these fields from one table:
> 
>  select user_id, username, user_email, user_regdate, user_lastvisit
> from phpbb_users where user_id > 50;
> 
> into the other (already existing) table:
> 
>  select uid, name, mail, created, access from drupal_users;

INSERT INTO drupal_users (uid, name, mail, created, access)
  SELECT user_id, username, user_email, user_regdate, user_lastvisit
    FROM phpbb_users
    WHERE user_id > 50;

<http://www.postgresql.org/docs/9.0/interactive/sql-insert.html>

Michael Glaesemann
michael.glaesemann@xxxxxxxxxxxxxx




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux