PostgreSQL Sort

Viewed 2657

I have a sort problem in PostgreSQL with below data:

name
-----
@CF
@CG
CD
CE

I used select name from table order by name, the result as below:

name
-----
CD
CE
@CF
@CE

It seems that Postgres just ignores the special character @ and sorts the left string. However, I'd like it sorted like this:

name
-----
@CF
@CG
CD
CE

Searching the internet didn't help. I hope someone here could give a suggestion.

4 Answers
Related