> 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