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

Home -> Community -> Mailing Lists -> Oracle-L -> RE : Re: group by sorting

RE : Re: group by sorting

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Thu, 19 Oct 2000 10:15:01 +0200
Message-Id: <10654.119747@fatcity.com>


Eric,

  I presume that using

    translate( ...,
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',                    

'ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmkljihgfedcba')

 could be considered as the character equivalent of -1 *, but you'd rather define the column as 'noprint' because it's ugly :-). And quite obviously it does nothing for NLS characters, all those é, ò, ñ, ä and ø which many European countries delight in (and I am only referring to the Latin alphabet) - but you can adapt the 'translate' to handle those too.

-- 
Regards,

  Stephane Faroult
  email: sfaroult_at_oriolecorp.com 
  Oriole Corporation
  Voice:  +44  (0) 7050-696-269 
  Fax:    +44  (0) 7050-696-449 
  Performance Tools & Free Scripts
------------------------------------------------------------------
http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs
------------------------------------------------------------------

> Reply-To:
> ORACLE-L_at_fatcity.com
> Organization:
> Fat City Network Services, San Diego, California
> To:
> Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>
>
> Cool!
>
> How do you get the inverse of other non-numeric fields?
>
> thanks,
> ep
>
>
> On 18 Oct 2000, at 6:20, Rod Corderey wrote:
>
> Date sent: Wed, 18 Oct 2000 06:20:56 -0800
> To: Multiple recipients of list ORACLE-L
> <ORACLE-L_at_fatcity.com>
> Send reply to: ORACLE-L_at_fatcity.com
>
> > As others have said , you can simply add an order by after the group by.
> >
> > Unless the group by is part of an inner query or inline view. In that
> case an order
> > by is not allowed.
> >
> > The way to overcome this is to group by the necessary columns to satisfy
> the group
> > functions but then add an overriding value to your group by to which you
> can apply
> > a factor of -1,
> >
> > eg
> > presuming that invoice_no is numeric
> >
> > then group by invoice_no, invoice_date
> >
> > becomes group by invoice_no*-1, to_number(to_char(invoice_date,'J')) * -1
> >
> > or something similar.
> >
Received on Thu Oct 19 2000 - 03:15:01 CDT

Original text of this message

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