Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fA2NJvq29903 for ; Fri, 2 Nov 2001 18:19:58 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fA2NAvd46669 for pgsql-sql@postgresql.org; Fri, 2 Nov 2001 18:10:57 -0500 (EST) (envelope-from news) From: Orion X-Newsgroups: comp.databases.postgresql.sql Subject: Help with a complex Update Date: Fri, 02 Nov 2001 15:15:36 -0800 Organization: TrustCommerce Lines: 14 Message-ID: <9rv960$1des$1@news.tht.net> Reply-To: o2@trustcommerce.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: scrappy@hub.org User-Agent: KNode/0.6.1 To: pgsql-sql@postgresql.org X-Archive-Number: 200111/51 X-Sequence-Number: 5435 I have a table of users and a table of user_actions. I'd like to have a first_action column in the user table. How would I go about updating that info. I'd immagine it'd be something like this: update user_info set first_action = (select min(action_timestamp) from action_info where user_id = ?? current user id ??); Is this possible or do I have to make an external for loop? Orion