Received: from Radha.DoCS.UU.SE (root@Radha.DoCS.UU.SE [130.238.9.99]) by hub.org (8.9.3/8.9.3) with SMTP id GAA05973 for ; Thu, 28 Oct 1999 06:58:37 -0400 (EDT) (envelope-from e99re41@DoCS.UU.SE) Received: from Puma.DoCS.UU.SE (e99re41@Puma.DoCS.UU.SE [130.238.9.112]) by Radha.DoCS.UU.SE (8.6.12/8.6.12) with ESMTP id MAA15396; Thu, 28 Oct 1999 12:58:32 +0200 Received: from localhost (e99re41@localhost) by Puma.DoCS.UU.SE (8.6.12/8.6.12) with SMTP id MAA03815; Thu, 28 Oct 1999 12:58:30 +0200 X-Authentication-Warning: Puma.DoCS.UU.SE: e99re41 owned process doing -bs Date: Thu, 28 Oct 1999 12:58:29 +0200 (MET DST) From: Peter Eisentraut Reply-To: Peter Eisentraut To: "Imtiaz. S. M" cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] SQL Problem In-Reply-To: <381829A7.67949B14@yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII UPDATE second_table SET date_column = (SELECT min(date_column) FROM first_table); On Thu, 28 Oct 1999, Imtiaz. S. M wrote: > I have two tables which have exactly the same structure. Both of them > have one datetime column along with three other columns. But the > datetime column value in the second table is NULL for all the rows. Now > I want select the least date(date with the least value in the datetime > column) from the first table and update all the rows in the second table > with this least date value from the first table. I do not want to use > any compiler or host variables. I should be able to do this only using > SQL statements. Cn somebody please help me? Thanks in advance. > > regards > Imtiaz > > > ************ > > -- Peter Eisentraut Sernanders vaeg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden