Re: sort character data in arbitrary order? - Mailing list pgsql-general

From Michael Fuhr
Subject Re: sort character data in arbitrary order?
Date
Msg-id 20060114201007.GA7139@winnie.fuhr.org
Whole thread Raw
In response to sort character data in arbitrary order?  (Robert Paulsen <robert@paulsenonline.net>)
Responses Re: sort character data in arbitrary order?
List pgsql-general
On Sat, Jan 14, 2006 at 01:38:52PM -0600, Robert Paulsen wrote:
>
>     SELECT foo, bar, baz, FROM my_table WHERE state ~ '[abc]'
>     ORDER BY state ASC LIMIT 1.
>
> This works as expected. My problem is that I am relying on the collating
> sequence of the letters a-z and the desirability of states may not always be
> in this order.

How do you determine desirability?  You could order by an expression
that evaluates to a state's desirability.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Andrew - Supernews
Date:
Subject: Re: sort character data in arbitrary order?
Next
From: Shawn Garbett
Date:
Subject: Cube/Rollup/ and Connect by prior