Re: Help with join and distinct query

From: kopek <matezuka_at_yahoo.com>
Date: 1 Aug 2002 00:01:25 -0700
Message-ID: <f7cb1d69.0207312301.163cb5aa_at_posting.google.com>


I seriously doubt a SQL like "select distinct...." would give you duplicates.
What is the data type of AVL_TELLEVERK.AVLEST_TIDSPKT? Maybe what you saw were not duplicates at all. If AVL_TELLEVERK.AVLEST_TIDSPKT is varchar2, maybe there were trailing spaces?

  • K. M.

sweet_thursday_at_hotmail.com (Haavard Futsaeter) wrote in message news:<222e60a0.0207310551.3c0f7583_at_posting.google.com>...
> Hi. I am not that experienced with sql queries so I might be missing
> something obvious here. My problem is that the query returns a lot of
> duplicates. This probably occurs because I do three joins, but I try
> to remedy this with both GROUP BY and DISTINCT. Strangely enough, they
> do not change the output from the query at all.
>
> My troublesome query is the following:
>
> SELECT DISTINCT KUNDE.NAVN,AVL_TELLEVERK.AVLEST_TIDSPKT
> FROM KUNDE,ABONNEMENT,BETALER,AVL_TELLEVERK
> WHERE (KUNDE.KUNDE_ID=ABONNEMENT.KUNDE_ID AND
> ABONNEMENT.MAALER_ID=AVL_TELLEVERK.MAALERID AND
> ABONNEMENT.KUNDE_ID=BETALER.KUNDE_ID AND BETALER.NAVN='Bedrift' AND
> KUNDE.NAVN='kunde')
> GROUP BY KUNDE.NAVN,AVL_TELLEVERK.AVLEST_TIDSPKT
>
> Any help would be much appreciated.
>
>
> Thanks
> Haavard Futsaeter
Received on Thu Aug 01 2002 - 09:01:25 CEST

Original text of this message