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 -> Re: Order by with case unsensitive in UNION

Re: Order by with case unsensitive in UNION

From: Jerry Bull <Gerald.Bull_at_fmr.com>
Date: Mon, 04 Jan 1999 09:40:24 -0500
Message-ID: <3690D2D8.6F7B8047@fmr.com>


You could also try using an in-line view:

select * from (SELECT address1 from A

                       UNION SELECT address2 from B)
ORDER BY LOWER(address1)

toneczar_at_erols.com wrote:

> Xavier.Arques_at_alcatel.fr wrote:
>
> > I'm trying to sort datas in an UNION with case unsensitive:
> >
> > SELECT address1 from A
> > UNION
> > SELECT address2 from B
> > ORDER BY LOWER(1)
> >
> > but it doesn't work.
> >
> > Can some one tell me how to do ?
>
> In SQL*Plus, you could add a "hidden" column like this, and use it to sort:
>
> SQL> column sortkey noprint
> SQL> select lower(address1) sortkey, address1 address
> from a
> union
> select lower(address2) sortkey, address2 address
> from b
> order by 1;
>
> If not in SQL*Plus, you could select the data as above and just not display
> that sortkey column on screen, however your application does that.
>
> Chris
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Chris Hamilton -- toneczar_at_erols.com
> http://www.serve.com/cowpb/chamilton.html
> City of Washington Pipe Band
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Mon Jan 04 1999 - 08:40:24 CST

Original text of this message

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