Saturday, 15 March 2014

postgresql - How can I sort the postgres column with certain special characters? -


I am trying to sort on the letter column in a postgraduate database:

  Column 1 Select   

output from table order by column 1

  dir1 dir2 dir3 # num1 t1   

I have to print sorting order # num1 The first method sqlite does that need to convert any ideas into my query?

Collation setting for this type of possible solution "inactive":

  Together with the value of x (a) AS (VALUES ('dir1'), ('dir2'), ('dir3'), ('# num1'), ('T1')) a  COLLATE "C" / B>; Select   from  preorder 

PostgreSQL 9.1 or later.

Most locales will ignore the leading # for sorting if you switch to "c" , then the characters will effectively mark their byte values Are you sorted by i though you want it to be or may or may be.

Here are many related questions, such as:


No comments:

Post a Comment