Search Postgresql Archives

Re: How to sort strings containing a dot?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Adam. No, It doesn't.

But I have found a solution which works :

select name from (select distinct name from t) as name order by replace(name, '.', 'a');
   name
----------
 co.aaa
 co.abb
 co.cab
 co.ment
 com
 com.enta
(6 lines)


Thanks to all of you.


Adam Rich wrote :
>> By the way, I have just inserted a duplicate. Then I have run the
>> select statement with distinct and I got an error.
>>
>> How one can solve this?
>>
> 
> Does this work?
> 
> select distinct name 
> from (  select name from t order by replace(name, '.', 'a')) as t2
> 
> 
> 


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux