pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Orion <o2@trustcommerce.com>
To: pgsql-sql@postgresql.org
Subject: Help with a complex Update
Date: Fri, 02 Nov 2001 15:15:36 -0800
Message-ID: <9rv960$1des$1@news.tht.net> (raw)

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




view thread (3+ messages)  latest in thread

Message-ID: <9rv960$1des$1@news.tht.net>
Permalink:  ../9rv960$1des$1@news.tht.net/
Also on:    postgresql.org/message-id/9rv960$1des$1@news.tht.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: o2@trustcommerce.com
  Subject: Re: Help with a complex Update
  In-Reply-To: <9rv960$1des$1@news.tht.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox