Distinct oddity

From: Maximilian Tyrtania <maximilian(dot)tyrtania(at)onlinehome(dot)de>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Distinct oddity
Date: 2009-05-07 08:21:41
Message-ID: C62866B5.35DA3%maximilian.tyrtania@onlinehome.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi there,

does this look right?

FAKDB=# select count(distinct(f.land)) from firmen f where
f.typlist='Redaktion';
count
-------
1975
(1 row)

FAKDB=# select count(distinct(f.land||'1')) from firmen f where
f.typlist='Redaktion';
count
-------
4944
(1 row)

FAKDB=# select version();
version
----------------------------------------------------------------------------
----------------------------------------------------------
PostgreSQL 8.3.3 on powerpc-apple-darwin, compiled by GCC
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5370)
(1 row)

Why would the 2 queries give different results? No inserts occurred in the
meantime.

tia,

Maximilian Tyrtania

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message haries fajar nugroho 2009-05-07 08:24:22 ask about epoch query with datetime
Previous Message johnf 2009-05-03 22:26:58 Re: using a list to query