Re: [SQL] Doubts in timespan

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Paulo Roberto Kappke <paulok(at)cyclades(dot)com(dot)br>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Doubts in timespan
Date: 1999-08-30 15:19:12
Message-ID: l03130302b3f04f90bc5e@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 16:23 +0300 on 26/08/1999, Paulo Roberto Kappke wrote:

> "UPDATE tasktime SET elapsed_time='age((SELECT inserted_time FROM
> tasktime WHERE row=$row),(SELECT inserted_time FROM tasktime WHERE
> row=$old_row))' WHERE row=$old_row"

If I'm not mistaken, Postgres does not allow subselects to be used in this
context. In any case the age function should not be in quotes...

Instead, the syntax Postgres uses from the days of old would be something like

UPDATE tasktime
SET elapsed_time = age( tt.inserted_time, inserted_time )
FROM tasktime tt
WHERE row=$old_row AND tt.row = $row;

This has nothing to do with timespan.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message tjk@tksoft.com 1999-08-30 16:47:54 Re: [SQL] problem with select
Previous Message Tom Lane 1999-08-30 14:43:54 Re: [SQL] problem with select