pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: T.J.Farrell <T.J.Farrell@wanadoo.fr>
To: pgsql-sql@postgresql.org
Subject: Update table: extract max(hour).
Date: Sat, 3 Jun 2000 22:02:43 +0200
Message-ID: <000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer> (raw)

Hello,

I am trying to update one table based on another table data as follows:

                            TableStatus containts fields date (date), hour
(time), IDcode (text), status (text).
                            TableProduct contains fields state (text),
datestate (date), IDcode (text).

I want to update state and datestate based on the last status in
Tablestatus.
The problem is that I cannot extract a max(hour) from PG, and using
max(date) is not sufficient, as 2 status could be entered on the same day on
two different times.

I am unsure how to resolve this problem.
TIA




Message-ID: <000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer>
Permalink:  ../000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer/
Also on:    postgresql.org/message-id/000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: T.J.Farrell@wanadoo.fr
  Subject: Re: Update table: extract max(hour).
  In-Reply-To: <000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer>
  References: <000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer>

* 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