Re: ORDER BY and ignoring the , a , and an - Mailing list pgsql-general

From Gregory Wood
Subject Re: ORDER BY and ignoring the , a , and an
Date
Msg-id 003601c0b88b$294bc3d0$7889ffcc@comstock.com
Whole thread Raw
In response to ORDER BY and ignoring the , a , and an  ("Stoppel, Brett W" <bstoppel@ku.edu>)
List 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


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: missing data
Next
From: Tom Lane
Date:
Subject: Re: missing data