pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: A. R. Van Hook <hook@lake-lotawana.mo.us>
To: postgresql sql list <pgsql-sql@postgresql.org>
Subject: wrong answer
Date: Tue, 21 Aug 2007 08:09:50 -0500
Message-ID: <46CAE41E.8020707@lake-lotawana.mo.us> (raw)

I have a simple (and incorrect queuer) that gives the wrong answer.
Can someone show me the correct syntax?
t
"select sum(s.ref), r.value, s.ref from registry as s
left join referralkey as r on (s.ref = r.cd)
group by s.ref, r.value order by r.value, s.ref"
 sum  |      value      | ref
------+-----------------+-----
 3462 | A Friend        |   3
  150 | Bridal Guide    |   6
   33 | Coupon          |  11

yet
     qs "select count(*) from registry where ref =3"
 count = 1154
     qs "select count(*) from registry where ref=6"
count = 25
     qs "select count(*) from registry where ref=11"
count = 3
thanks

-- 
Arthur R. Van Hook

hook@lake-lotawana.mo.us
avanhook3@comcast.net

(816) 578-4704 - Home
(816) 629-0071 Cell





view thread (2+ messages)  latest in thread

Message-ID: <46CAE41E.8020707@lake-lotawana.mo.us>
Permalink:  ../46CAE41E.8020707@lake-lotawana.mo.us/
Also on:    postgresql.org/message-id/46CAE41E.8020707@lake-lotawana.mo.us

 · 

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: hook@lake-lotawana.mo.us
  Subject: Re: wrong answer
  In-Reply-To: <46CAE41E.8020707@lake-lotawana.mo.us>

* 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