Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Group By

Re: Group By

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 25 Apr 2001 22:27:13 +0200
Message-ID: <teecl1d846h04e@beta-news.demon.nl>

"roy fells" <molson_c_at_hotmail.com> wrote in message news:9c6rk302f6d_at_enews2.newsguy.com...
> Hey All,
> I have an element in my select statement (2 to be exact) that I don't want
> to group by but when I try to execute the query it says the element is not
 a
> group by expression. How do I make elements so that I can query without
> including them in a group by statement??
> Thanks for your help.
>
> Roy Fells
>
>

a somewhat ugly solution but it definitely will work

select a.group by column, b.non group by column, a.aggregate column from
(select group by column, aggregate function  from table
group by group by column )
, table b
where b.group by_column = a.group by column

Hth,

Sybrand Bakker, Oracle DBA Received on Wed Apr 25 2001 - 15:27:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US