pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Meynell <steve@candata.com>
To: Anuradha Ratnaweera <anuradha@gnu.org>
Cc: Postgresql Mailing List <pgsql-sql@postgresql.org>
Subject: Re: Heres a good one...
Date: Mon, 30 Apr 2001 11:15:20 -0400
Message-ID: <3AED8187.F17D6E61@candata.com> (raw)
References: <Pine.LNX.4.21.0104281903360.233-100000@presario>

First,  thank you very much for trying but you were a bit off the mark but
close.  Second, posting_date being of type char(4) is quite legal and
irrelevant for this exercise but for argument sake lets say char(15) but
apart from all that...

Your sql statement was close but it only update 4 out of the possible 6 that
is should have updated...  journal.objectid# 103 should have been updated
because of journal.objectid# 100 was and journal.objectid# 106 should have
been because it alone met the before March 31 and update flag = H criteria.
But it is a start for me thanks.

And your second sql statement just didn't work.  It said 'ERROR:  parser:
parse error at or near "select"'

Steve


Anuradha Ratnaweera wrote:

> First, posting_date in journal can _NOT_ be of type char(4)! I guess it is
> a "date".
>
> Try
>
> update journal set gl_update_flag='Y' from distrib where
> journal.gl_update_flag = 'H' and journal.posting_date <= '2001-03-31' and
> (journal.objectid = distrib.distrib_objectid or journal.objectid =
> distrib.source_objectid)
>
> or
>
> update journal set gl_update_flag='Y' where gl_update_flag = 'H' and
> posting_date <= '2001-03-31' and ((objectid in select distrib_objectid
> from distrib) or (objectid in select source_objectid from distrib))
>




view thread (4+ messages)  latest in thread

Message-ID: <3AED8187.F17D6E61@candata.com>
Permalink:  ../3AED8187.F17D6E61@candata.com/
Also on:    postgresql.org/message-id/3AED8187.F17D6E61@candata.com

 · 

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: steve@candata.com, anuradha@gnu.org
  Subject: Re: Heres a good one...
  In-Reply-To: <3AED8187.F17D6E61@candata.com>
  References: <Pine.LNX.4.21.0104281903360.233-100000@presario> <3AED8187.F17D6E61@candata.com>

* 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