Re: [GENERAL] is (not) distinct from - Mailing list pgsql-general

From Johann Spies
Subject Re: [GENERAL] is (not) distinct from
Date
Msg-id CAGZ55DRDyRehXwx827pmsa7992Uqmx1=oKG4vpNdW5-9N6B3QA@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] is (not) distinct from  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: [GENERAL] is (not) distinct from  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On 28 February 2017 at 17:06, Adrian Klaver <adrian.klaver@aklaver.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)

pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [GENERAL] Understanding pg_last_xlog_receive_location
Next
From: "Sven R. Kunze"
Date:
Subject: Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE