Path: news.easynews.com!easynews!feedwest.aleron.net!aleron.net!sfo2-feed1.news.algx.net!allegiance!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!news.boulder.noaa.gov!not-for-mail
From: Thomas Gaines <Thomas.Gaines@noaa.gov>
Newsgroups: comp.databases.oracle.server
Subject: Re: URGENT: sql group by clause has stopped working
Date: Thu, 08 Aug 2002 17:28:31 -0600
Organization: NOAA Boulder
Lines: 71
Message-ID: <3D52FE9F.4D260EA9@noaa.gov>
References: <mVC49.103$Ot2.12202@news.optus.net.au>
NNTP-Posting-Host: tg2k.ngdc.noaa.gov
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------EF80E3403A11EEF94CE21647"
X-Trace: mwrns.noaa.gov 1028849261 11949 192.149.148.31 (8 Aug 2002 23:27:41 GMT)
X-Complaints-To: usenet@news.boulder.noaa.gov
NNTP-Posting-Date: Thu, 8 Aug 2002 23:27:41 +0000 (UTC)
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
Xref: easynews comp.databases.oracle.server:157310
X-Received-Date: Thu, 08 Aug 2002 16:27:12 MST (news.easynews.com)
--------------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

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--

