pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joel Fradkin <jfradkin@wazagua.com>
To: pgsql-sql@postgresql.org
Subject: trying to do an update a bit confused.
Date: Tue, 19 Apr 2005 10:06:07 -0400
Message-ID: <000001c544e8$ef28d820$797ba8c0@jfradkin> (raw)

update tblcase  set merchandisetotal = 

(

COALESCE(( SELECT sum(m.quantity::numeric * m.amount) AS merchandiseamount

           FROM tblmerchandise m

          WHERE m.caseid = tblcase.caseid AND m.clientnum::text =
tblcase.clientnum::text), 0.0)

)

 

I tried running the above and it wants to do a sum on all the records in
tblcase instead of just the one being updated, what am I doing wrong?

 

Joel Fradkin

 

 

 

view thread (4+ messages)  latest in thread

Message-ID: <000001c544e8$ef28d820$797ba8c0@jfradkin>
Permalink:  ../000001c544e8$ef28d820$797ba8c0@jfradkin/
Also on:    postgresql.org/message-id/000001c544e8$ef28d820$797ba8c0@jfradkin

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jfradkin@wazagua.com
  Subject: Re: trying to do an update a bit confused.
  In-Reply-To: <000001c544e8$ef28d820$797ba8c0@jfradkin>

* 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