Received: from serv0.ilse.net (serv0.ilse.nl [194.158.182.236]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA45400 for ; Fri, 15 Oct 1999 09:23:12 -0400 (EDT) (envelope-from mathijs@ilse.nl) Received: (from mathijs@localhost) by serv0.ilse.net (8.8.8/8.6.12) id PAA01872; Fri, 15 Oct 1999 15:23:10 +0200 (MET DST) Date: Fri, 15 Oct 1999 15:23:10 +0200 From: Mathijs Brands To: John C Cusick Cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] HOW DO I... Message-ID: <19991015152309.A1841@ilse.nl> References: <19991015.085403.-768299.0.jcc2@juno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <19991015.085403.-768299.0.jcc2@juno.com> X-Unexpected-Header: The Spanish Inquisition On Fri, Oct 15, 1999 at 08:54:01AM -0400, John C Cusick allegedly wrote: > To All, > > How do I select from one table into another table > that already exists? > > 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 > > If I : select * into table tblB from tblA where attrN like 'xxx'; > > I get the same answer. > > I also tried using 'update' > > So, How do I update a smaller table from a larger table? > > For those who wish to know, This is a large parts database that > is updated monthly and I have divided it into smaller subsections for > quick access through a web-based interface. Searching the original > table is much too time consuming ( over 130,000 part #'s with Specs and > Descriptions - all running on an ancient 80386). And I would like > to avoid updating the smaller tables by re-building them from scratch. > > Thanks for your time, > > John C. Shouldn't you be doing the following? insert into tblB select * from tblA where attrN like 'xxx'; Mathijs