Received: from smtp1.mindspring.com (smtp1.mindspring.com [207.69.200.31]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA53889 for ; Wed, 16 Jun 1999 13:06:48 -0400 (EDT) (envelope-from bkruger@mindspring.com) Received: from oplsrv3 (user-38h1to5.dialup.mindspring.com [209.16.247.5]) by smtp1.mindspring.com (8.8.5/8.8.5) with SMTP id NAA10252 for ; Wed, 16 Jun 1999 13:06:46 -0400 (EDT) Message-Id: <3.0.5.32.19990616120624.007e95e0@mindspring.com> X-Sender: bkruger@mindspring.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 16 Jun 1999 12:06:24 -0500 To: pgsql-sql@postgresql.org From: Bob Kruger Subject: Updating Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Thanks for all who assisted with my previous question on grouping. I would like to do an update of a table with the results of a query on another. For example: table vehcost id serial po varchar(12) veh_no varchar(8) cost real comments varchar(30) table vehinfo id serial veh_no varchar(12) m_cost real ... I would like to take the sum of vehcost.veh_no and update that info to field vehinfo.m_cost. So far, I have worked with the following without success: update vehinfo set m_cost = (select sum(vehcost.cost) from vehcost group by veh_no) where vehinfo.veh_no = vehcost.veh_no ; Any ideas. Thanks in advance for any assistance. Regards - Bob Kruger