Providing there is simple table, called "test_xx", which has only one
column, called
"aa" CHAR(16), and the column is set as primary key. Put in some data such
as following.
( _ stands for a space character)
'AA_B'
'AAB'
'BB_123'
'BB123'
Execute following statement with psql.
SELECT * FROM test_xx ORDER BY aa;
I 've got ...
'AAB'
'AA_B'
'BB123'
'BB_123'
But if excute
SELECT subStr(aa, 1,4) FROM test_xx ORDER BY aa;
I've got ..
'AA_B'
'AAB'
BB_12'
BB123'
jack