Re: GROUP BY clause
- From: Jan Krueger <jk@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 09 Sep 2007 19:36:13 +0200
brenda.beltran@xxxxxxxxx wrote:
Hi everybody,Hi Brenda,
I just got to this area, so hope someone can help me with the
following issue, I will really appreciate it.
I want to query a column that is not part of the GROUP BY clause:
SELECT c.country_id,
r.region_id,
r.manag_id,
SUM(r.sls),
SUM(r.cst)
FROM country c INNER JOIN region r ON c.country_key = r.country_key
GROUP BY c.country_id,
r.region_id;
Obviously, it's complaining because r.manag_id is not in the GROUP
BY clause, but I need the result set to be as defined in the column
clause. I wonder if there is any way to have these same columns in my
query keeping my GROUP BY clause as it is now.
maybe I didn't get the point here, but I can't see the benefit of the inline view suggestions.
If you just add the r.manag_id as a third column to your group by clause, why is the resultset different from the one you expect?
Jan
.
- Follow-Ups:
- Re: GROUP BY clause
- From: fitzjarrell@xxxxxxx
- Re: GROUP BY clause
- References:
- GROUP BY clause
- From: brenda . beltran
- GROUP BY clause
- Prev by Date: Re: newbie, getting cost plan
- Next by Date: Re: how could I see number of updated rows?
- Previous by thread: Re: GROUP BY clause
- Next by thread: Re: GROUP BY clause
- Index(es):
Relevant Pages
|