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

Home -> Community -> Usenet -> c.d.o.server -> group by / columns

group by / columns

From: Sammy <Sammy_at_somewhere.nl>
Date: Thu, 25 Jan 2001 18:35:57 +0100
Message-ID: <TLST600291AC5@telestars.nl>

Hi,

I am migrating all SQL statements from SQLBase to Oracle (8.0.5.) In SQLBase it was possible to use the column numbers in group by and order by statements.
Example

Select @datevalue(...) As TheDate,

           @left(...)          As Tframe,
           count(*)           As Amount,
            (...)

From (...)

where (...)

group by 2,1
order by 2,1;

This doesn't work with Oracle. I can use the assigned column names in the order by clause, but it seems that I have to use the full expression in the group by clause. In Oracle it would look like this:

group by substr(...),to_date(...)
order by Tframe,TheDate;

Is there any other way I can refer to to expressions in the group by clause ?

TIA, Sammy Received on Thu Jan 25 2001 - 11:35:57 CST

Original text of this message

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