wrong answer - Mailing list pgsql-sql

From A. R. Van Hook
Subject wrong answer
Date
Msg-id 46CAE41E.8020707@lake-lotawana.mo.us
Whole thread Raw
Responses Re: wrong answer  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: [GENERAL] Join query help
Next
From: Richard Huxton
Date:
Subject: Re: wrong answer