From: "Ada Zhao" <azhao@exchange.ml.com>
Subject: Re: SQL Blues......Part 2    HELP!!!
Date: 2000/07/07
Message-ID: <8k5brf$41b$1@news.ml.com>#1/1
References: <yWO85.382$87.2461@news1.mts.net> <8k1iql$f7a$1@hdxl22.telecom.ptt.nl> <4s095.1881$87.4703@news1.mts.net> <8k27ce$267$1@hdxl22.telecom.ptt.nl> <RI195.1883$87.4856@news1.mts.net>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Complaints-To: usenet@news.ml.com
X-Trace: news.ml.com 962998959 4139 146.125.8.205 (7 Jul 2000 19:42:39 GMT)
X-MSMail-Priority: Normal
NNTP-Posting-Date: 7 Jul 2000 19:42:39 GMT
Newsgroups: comp.databases.oracle.misc


You will need to add date_caught in the group by as well. The SQL should
read:
select pin, date_caught , max(actual_points)
from catch_entries
groupy bypin,date_caught
 order by max(actual_points) desc

"Newbie (Joe)" <jranseth@hotmail.com> wrote in message
news:RI195.1883$87.4856@news1.mts.net...
> It works fine when I only include the fields "pin" and max(actual_points)
> but whenever I add another field, it gives me a group by error.
>
> ie: "select pin, max(actual_points) from catch_entries groupy by pin order
> by max(actual_points) desc" works fine...
> BUT
> "select pin, max(actual_points), date_caught from catch_entries groupy by
> pin order by max(actual_points) desc"
> produces an error saying not a group by expression.....
>
> Any clues?
> --
> "jAnO!" <j.j.groot@kpn.com> wrote in message
> news:8k27ce$267$1@hdxl22.telecom.ptt.nl...
> >
> > mAd hAcker <madhackerboy@hotmail.com> wrote in message
> > news:4s095.1881$87.4703@news1.mts.net...
> > > Okay, I tried that.....but I keep getting an error -
> > > "ORA-00979: not a GROUP BY expression"
> > > Why isn't it a GROUP BY expression?
> >
> > I'm not sure but i think it has something to do with te fact that you're
> > also selecting columns  that have specific data thats different for
 multiple
> > rows.
> > Maybe you should trie to select at first only player_name and max_point
> > make that one work and gradualy make your query larger..
> >
> > greetz
> >
> > Jan
> > (taking OCP exam 1 next week..)
> >
> >
> >
> >
> >
> >
>
>




