Re: is (not) distinct from

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: is (not) distinct from
Date: 2017-03-01 08:15:51
Message-ID: CAGZ55DRDyRehXwx827pmsa7992Uqmx1=oKG4vpNdW5-9N6B3QA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28 February 2017 at 17:06, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

>
> I have not worked through all this but at first glance I suspect:
>
> select distinct b.* from b ...
>
> is distinct from ...
>
> constitutes a double negative.
>
> What happens if you eliminate the first distinct?
>
>
>
> Thanks Adrian,

The dynamics of the data has changed because of data updates so an exact
comparison is not possible.

Other tests now confirm that the 28 records are identical in both tables.
The results then become more confusing:

If I remove the first distinct
and use "is distinct from"

I get 756 rows

and when I use "is not distinct from"

I get 28.

In the first (756) case when I use "group by" the result of the first query
is exactly the same as the second one.

Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sven R. Kunze 2017-03-01 13:36:15 Re: ERROR: functions in index expression must be marked IMMUTABLE
Previous Message Andres Freund 2017-03-01 06:30:16 Re: [GENERAL] C++ port of Postgres