Help with a complex Update

From: Orion <o2(at)trustcommerce(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Help with a complex Update
Date: 2001-11-02 23:15:36
Message-ID: 9rv960$1des$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bhuvan A 2001-11-03 03:39:49 Strange Problem As Type Casting
Previous Message Tom Lane 2001-11-02 15:23:37 Re: View consistency