Re: [SQL] HOW DO I...

From: Mark Jewiss <Mark(dot)Jewiss(at)knowledge(dot)com>
To: John C Cusick <jcc2(at)juno(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] HOW DO I...
Date: 1999-10-15 13:14:03
Message-ID: Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

On Fri, 15 Oct 1999, John C Cusick wrote:

> In other words, if I do a:
> select * into tblB from tblA where attrN like 'xxx';
>
> and both table structures are identical I get a
> ERROR: Relation 'tblB' already exists

Correct, the 'select into...' statement attempts to create the table, not
just insert rows.

I had this problem on a different system (which I haven't tried to do in
pgsql), where the solution was:

insert into tbl1
select * from tbl2 where this = that

I *think* you could declare a value list as in a normal insert. I also
think that this is SQL, not something specific to that db system, but I
may be wrong.

Regards,

Mark.
--
Mark Jewiss
Knowledge Matters Limited
http://www.knowledge.com

In response to

  • HOW DO I... at 1999-10-15 12:54:01 from John C Cusick

Browse pgsql-sql by date

  From Date Subject
Next Message Mathijs Brands 1999-10-15 13:23:10 Re: [SQL] HOW DO I...
Previous Message John C Cusick 1999-10-15 12:54:01 HOW DO I...