Re: Query problem

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Naz Gassiep *EXTERN*" <naz(at)mira(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query problem
Date: 2007-10-01 12:02:58
Message-ID: D960CB61B694CF459DCFB4B0128514C244386C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Naz Gassiep wrote:
> Aside from the messy nomenclature, is anyone able to spot why
> the "sum" column from the first query is not returning 7, as
> the second query suggests that it should? I know that this is
> probably simple, and that It's probably going to jump out at
> me the minute I hit "Send", but if I don't hit send, then I'll
> never see it hehe.
>
> twerl=# SELECT ... SUM(contacts.id) ... FROM ... contacts ...
> ... | sum | ...
> ...-+-----+-...
> ... | 594 | ...
> (1 row)
>
> twerl=# select count(*) from contacts where groupid = 3;
> count
> -------
> 7
> (1 row)

That's an easy one.

I assume that there are three rows in table "contacts", and
the values of the "id" column are 42, 123 and 429 (or similar).

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nis Jørgensen 2007-10-01 12:07:31 Re: ERROR: invalid byte sequence from psql - Works perfectly from pgAdmin III query window
Previous Message Albe Laurenz 2007-10-01 11:43:16 Re: ERROR: invalid byte sequence from psql - Works perfectly from pgAdmin III query window