Re: How to sort strings containing a dot?

From: Steve Wampler <swampler(at)noao(dot)edu>
To: Pierre LEBRECH <pierre(dot)lebrech(at)laposte(dot)net>
Subject: Re: How to sort strings containing a dot?
Date: 2008-03-25 17:09:06
Message-ID: 47E931B2.6090405@noao.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pierre LEBRECH wrote:
> But I have found a solution which works :
>
> select name from (select distinct name from t) as name order by replace(name, '.', 'a');

Shouldn't you replace '.' with a character whose collating sequence is strictly less than
'a'? This solution looks to me as though it might not get ,e.g., 'coast' and 'co.st' in
the desired order except by chance.

--
Steve Wampler -- swampler(at)noao(dot)edu
The gods that smiled on your birth are now laughing out loud.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2008-03-25 17:10:57 Re: pg_ctrl stop problems (psql 8.2.5)
Previous Message Roberts, Jon 2008-03-25 17:07:14 Re: How to sort strings containing a dot?