From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | wwwadmin(at)wizard(dot)ca (Michael) |
Cc: | pgsql-admin(at)postgreSQL(dot)org |
Subject: | Re: [ADMIN] Updating tuples based on max time |
Date: | 1998-08-22 03:20:19 |
Message-ID: | 199808220320.XAA04020@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
6.4 will have the HAVING clause, that will testing of aggregates.
6.4 beta is September 1.
> I keep crashing my backend doing the following
> UPDATE logins SET
> logoff_time='now'
> WHERE
> login_time=max(login_time)
> AND
> account_name='tempuser'
> ;
>
> login_time is type 'datetime'
>
> As a side note, I used this method because the following didn't work
> UPDATE logins SET
> logoff_time='now'
> WHERE
> id=(SELECT DISTINCT id FROM logins
> WHERE
> login_time IS NOT NULL
> AND
> account_name='tempuser'
> )
> ;
>
> Point is, what is the best method to update a record based on it's
> datetime being the most recent?
>
>
>
--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)
From | Date | Subject | |
---|---|---|---|
Next Message | liuye | 1998-08-24 08:30:40 | Initdb cannot work with postgres 6.3.2 under RH5.0 |
Previous Message | roland.wild | 1998-08-21 16:06:52 | Quistion on PostgreSQL ! |