Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5CK3RE60498 for ; Tue, 12 Jun 2001 16:03:27 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 70963; Tue, 12 Jun 2001 13:03:21 -0700 From: "Josh Berkus" Subject: Re: update from another table To: "ivan" , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Tue, 12 Jun 2001 13:03:21 -0700 Message-ID: In-Reply-To: <9fq8eq$1cpd$1@news.tht.net> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200106/189 X-Sequence-Number: 3445 Ivan, > i would like to know how can i update a table with columns from > another > table and adding a new column with a secuence, You cannot update a table and add a new column at with one statement. Updating a table is Data Manipulation Language (DML) and adding a column is Data Definition Language (DDL) and the two may not be combined. For the update statement: > update table > set column = (select column from table2), ......, set > column=secuence.. > > is it right????? Nope. Try UPDATE table1 SET columnC = table2.columnB FROM table2 WHERE table2.columnA = table1.columnA -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco