Re: ORDER BY and ignoring the , a , and an

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Stoppel, Brett W" <bstoppel(at)ku(dot)edu>
Cc: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ORDER BY and ignoring the , a , and an
Date: 2001-03-29 20:02:18
Message-ID: 003601c0b88b$294bc3d0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is it possible to have the ORDER BY option ignore the articles "the ", "a
",
> and "an " at the beginning of a VARCHAR, CHAR, TEXT, et cetera field? In
> other words, I want my results to come back alphabetized, while ignoring
the
> aforementioned articles.

I suppose you could write a function (say strip_articles) to strip those
words out (and anything else you'd like), then do an ORDER BY
strip_articles(MyField).

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2001-03-29 20:06:41 Re: ORDER BY and ignoring the , a , and an
Previous Message Dave Perkins 2001-03-29 19:56:47 missing data