Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1334A475DC2 for ; Tue, 3 Sep 2002 14:52:26 -0400 (EDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 1609A476403 for ; Tue, 3 Sep 2002 14:51:45 -0400 (EDT) Received: (qmail 20575 invoked by uid 0); 3 Sep 2002 18:51:34 -0000 Received: from pd902f08c.dip0.t-ipconnect.de (217.2.240.140) by mail.gmx.net (mp007-rz3) with SMTP; 3 Sep 2002 18:51:34 -0000 Date: Tue, 3 Sep 2002 20:55:52 +0200 (CEST) From: Peter Eisentraut X-X-Sender: peter@localhost.localdomain To: "Yudie@axiontech.com" Cc: pgsql-sql@postgresql.org Subject: Re: Update Help In-Reply-To: <001a01c25368$5b374c10$8a01a8c0@yudie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/17 X-Sequence-Number: 9294 Yudie@axiontech.com writes: > Let say I have 2 Product table, both of them has columns ProductID and > Price What is the update command if I want to update all Prices of first > table to be equal with Price in second table? Possibly you mean something like this: UPDATE first_table SET price = (SELECT price FROM second_table WHERE second_table.productid = first_table.productid); Possibly the answer is also to redesign your schema to avoid redundant data. -- Peter Eisentraut peter_e@gmx.net