Re: How to sort strings containing a dot? - Mailing list pgsql-general

From Roberts, Jon
Subject Re: How to sort strings containing a dot?
Date
Msg-id 1A6E6D554222284AB25ABE3229A92762E9A01C@nrtexcus702.int.asurion.com
Whole thread Raw
In response to How to sort strings containing a dot?  (Pierre LEBRECH <pierre.lebrech@laposte.net>)
Responses Re: How to sort strings containing a dot?  (Pierre LEBRECH <pierre.lebrech@laposte.net>)
Re: How to sort strings containing a dot?  (Pierre LEBRECH <pierre.lebrech@laposte.net>)
List pgsql-general
create table t (name varchar);

insert into t values ('co.aaa');
insert into t values ('co.abb');
insert into t values ('co.cab');
insert into t values ('com');
insert into t values ('co.ment');
insert into t values ('com.enta');

select name from t order by replace(name, '.', '');


Jon

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Pierre LEBRECH
> Sent: Tuesday, March 25, 2008 9:56 AM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] How to sort strings containing a dot?
>
> Hello,
>
> I want to sort strings containing a dot but by taking care of this dot
> like any other character.
>
> example :
>
> Currently, I get this after the sort :
>
> co.aaa
> co.abb
> co.cab
> com
> co.ment
> com.enta
>
> But I would like to get this :
>
> co.aaa
> co.abb
> co.cab
> co.ment
> com
> com.enta
>
> How I can do this?
> Thank you
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Pierre LEBRECH
Date:
Subject: How to sort strings containing a dot?
Next
From: "Alain Roger"
Date:
Subject: Re: return value from SQL statement