Path: news.easynews.com!easynews!newshosting.com!news-xfer2.atl.newshosting.com!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!intgwlon.nntp.telstra.net!news.telstra.net!newsfeeds.bigpond.com!not-for-mail
Message-ID: <3D530327.AD6CBE8B@oracle.com>
From: Richard Foote <Richard.Foote@oracle.com>
Organization: Oracle Corporation
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server
Subject: Re: URGENT: sql group by clause has stopped working
References: <mVC49.103$Ot2.12202@news.optus.net.au> <3D52FE9F.4D260EA9@noaa.gov> <ZgD49.106$Ot2.12202@news.optus.net.au>
Content-Type: multipart/mixed;
 boundary="------------89F409D505BA8EFC08DE41D3"
Lines: 146
Date: Fri, 09 Aug 2002 09:47:51 +1000
NNTP-Posting-Host: 144.138.154.166
X-Trace: newsfeeds.bigpond.com 1028850368 144.138.154.166 (Fri, 09 Aug 2002 09:46:08 EST)
NNTP-Posting-Date: Fri, 09 Aug 2002 09:46:08 EST
Xref: easynews comp.databases.oracle.server:157314
X-Received-Date: Thu, 08 Aug 2002 16:50:38 MST (news.easynews.com)
--------------89F409D505BA8EFC08DE41D3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi Blah,

What's the datatype of owner ?

Are you sure the values are identical (no hidden characters) ?

Try:

select dump(owner)
from smith
blah blah     => I thought you might appreciate this :)

and confirm the values indeed are identical.

It is a little clearer if you write your query as

select distinct owner
from smith
blah blah

Cheers

Richard
blah wrote:
> 
> In article <3D52FE9F.4D260EA9@noaa.gov>, Thomas Gaines <Thomas.Gaines@noaa.gov> wrote:
> >
> >--------------EF80E3403A11EEF94CE21647
> >Content-Type: text/plain; charset=us-ascii
> >Content-Transfer-Encoding: 7bit
> >
> >Mr. Blah -
> >
> >Your "group by" clause is useless here.  Why are you even including
> >it?  This clause is meaningful only when you have a single-group
> >group function in your statement.  Something like this is more helpful:
> >
> >select owner, count (*)
> >from smith
> >where job = 'comp'
> >and branch = '9'
> >group by owner;
> >
> >Tom
> Also I set up a test table called test:
> 
> name          name1    name2
> 
> chris           po              po
> chris           po              po
> chris           po              po
> 
> Now I run :
> 
> select name
> from test
> where name1 = 'PO'
> and name2 = 'PO'
> group by name;
> 
> The result is:
> Chris
> 
> No duplicates?
> 
> Thanks
> 
> 
> 
> >
> >blah wrote:
> >
> >> Hi All,
> >>
> >> I can't figure this out.
> >>
> >> select owner
> >> from smith
> >> where job = 'comp'
> >> and branch = '9'
> >> group by owner;
> >>
> >> How can the above query return duplicates?
> >>
> >> Thanks,
> >> Wilk
> >
> >
> >
> >--------------EF80E3403A11EEF94CE21647
> >Content-Type: text/html; charset=us-ascii
> >Content-Transfer-Encoding: 7bit
> >
> ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> ><html>
> >Mr. Blah -
> ><p>Your "group by" clause is useless here.&nbsp; Why are you even including
> ><br>it?&nbsp; This clause is meaningful only when you have a single-group
> ><br>group function in your statement.&nbsp; Something like this is more
> >helpful:
> ><p><tt><font color="#FF0000">select owner, count (*)</font></tt>
> ><br><tt><font color="#FF0000">from smith</font></tt>
> ><br><tt><font color="#FF0000">where job = 'comp'</font></tt>
> ><br><tt><font color="#FF0000">and branch = '9'</font></tt>
> ><br><tt><font color="#FF0000">group by owner;</font></tt>
> ><p>Tom
> ><p>blah wrote:
> ><blockquote TYPE=CITE>Hi All,
> ><p>I can't figure this out.
> ><p>select owner
> ><br>from smith
> ><br>where job = 'comp'
> ><br>and branch = '9'
> ><br>group by owner;
> ><p>How can the above query return duplicates?
> ><p>Thanks,
> ><br>Wilk</blockquote>
> >
> ><br>&nbsp;</html>
> >
> >--------------EF80E3403A11EEF94CE21647--
> >
--------------89F409D505BA8EFC08DE41D3
Content-Type: text/x-vcard; charset=UTF-8;
 name="Richard.Foote.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Richard Foote
Content-Disposition: attachment;
 filename="Richard.Foote.vcf"

begin:vcard 
n:;Richard
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Richard.Foote@oracle.com
fn:Richard Foote
end:vcard

--------------89F409D505BA8EFC08DE41D3--

