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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Q:Sorting titles without the articles.

Re: Q:Sorting titles without the articles.

From: Dan Rippel <jford_at_mail.erols.com>
Date: 1997/01/25
Message-ID: <32ea0abc.3048586@news.erols.com>#1/1

As far as ignoring the articles, here are two quick ideas

1.If you have to do this in a sinlge query then

select title
from x
order by replace( title, 'a', '', 'the', '' ... )

This may be a kludge but there are really only a few number of articles.

2. How about adding a column called sort_title and an insert trigger to the table. The insert trigger will do a look up against the article table and remove all leading articles as new rows are added. Then your queries will be something like select title
from x
sort by sort_title

As far as the second question goes there is a function for converting characters and character sets.

On Thu, 23 Jan 1997 08:36:18 +0100, Erwin Meekers <emeekers_at_luc.ac.be> wrote:
>I've a table with titles and I want to sort these titles without the
>articles (a, the, ...). E.g. : "The Oracle Database" should be sorted as
>"Oracle Database"; "A good book" should be sorted as "good book".
>
>I store these articles in a separate table. Is there a kind of SORT BY
>that can solve this problem? We are currently using Oracle 7.2, but we
>will upgrade to 7.3.
>
>When sorting there is another problem : I want to sort special
>characters like "é" (alt + 130) as "e". Is there a kind of option to do
>this too?
Received on Sat Jan 25 1997 - 00:00:00 CST

Original text of this message

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