pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>
To: pgsql-sql@postgresql.org
Subject: Distinct oddity
Date: Thu, 07 May 2009 10:21:41 +0200
Message-ID: <C62866B5.35DA3%maximilian.tyrtania@onlinehome.de> (raw)

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





view thread (20+ messages)  latest in thread

Message-ID: <C62866B5.35DA3%maximilian.tyrtania@onlinehome.de>
Permalink:  ../C62866B5.35DA3%25maximilian.tyrtania@onlinehome.de/
Also on:    postgresql.org/message-id/C62866B5.35DA3%maximilian.tyrtania@onlinehome.de

 · 

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: maximilian.tyrtania@onlinehome.de
  Subject: Re: Distinct oddity
  In-Reply-To: <C62866B5.35DA3%maximilian.tyrtania@onlinehome.de>

* 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