Re: JOIN producing duplicate results - Mailing list pgsql-novice

From Binand Sethumadhavan
Subject Re: JOIN producing duplicate results
Date
Msg-id CAFBJCCZ5AFRKGY96gVONc_MT17da_tgEZiBx2taaRjSJ1Gogfg@mail.gmail.com
Whole thread Raw
In response to JOIN producing duplicate results  (Lonni J Friedman <netllama@gmail.com>)
List pgsql-novice
On 3 May 2012 05:21, Lonni J Friedman <netllama@gmail.com> wrote:
> I've got a query that is joining data across 4 tables to provide data
> based on test results.  The query is working fine, except for the fact

[snip]

This is your query formatted in my favourite SQL formatting style:

http://pastebin.com/cjGAyZ4U

It looks OK to me, so the only reason I can think of (without knowing
the DDL etc.) is data duplication. I would suggest you remove the
joined tables one by one and see which of them is introducing the
duplication (or alternatively, start by querying only smoketests and
then add the joined tables one by one to see which one introduces the
duplication). Then explore the data in that table.

Incidentally, you are not using the table "smoke" for anything. That
would be the first table I'd remove.

Binand

pgsql-novice by date:

Previous
From: Lonni J Friedman
Date:
Subject: JOIN producing duplicate results
Next
From: Bibek Behera
Date:
Subject: REGARDING ADDING A DATATYPE LIKE POLYGON