Re: sort character data in arbitrary order?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Robert Paulsen <robert(at)paulsenonline(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sort character data in arbitrary order?
Date: 2006-01-14 20:10:07
Message-ID: 20060114201007.GA7139@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2006-01-14 22:45:33 Re: Cube/Rollup/ and Connect by prior
Previous Message Andrew - Supernews 2006-01-14 20:06:40 Re: sort character data in arbitrary order?