a strange order by behavior

Поиск
Список
Период
Сортировка
От Eyal Wilde
Тема a strange order by behavior
Дата
Msg-id BANLkTi=ScMyF7nHQ6nhbyYr9UDrq16U=9g@mail.gmail.com
обсуждение исходный текст
Ответы Re: a strange order by behavior  (Samuel Gendler <sgendler@ideasculptor.com>)
Список pgsql-sql
the database collation is: en_US.UTF-8

drop table t1;
create table t1 (recid int ,f1 varchar(20));
insert into t1 values (1,'a');
insert into t1 values (2,' ');
insert into t1 values (3,'aa');
insert into t1 values (4,' a');
select * from t1 order by f1

result:

recid  f1
2      " "        
1      "a"        -- 2 comes before 1 because space is smaller then 'a'. fine.
4      " a"       -- now is see that 1 comes before 4 because space is greater then 'a' !?
3      "aa"       -- now again, 4 comes before 3 because space is smaller the 'a' !?!

can someone explain what's going on?

thanks!

В списке pgsql-sql по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: problem with selecting from a function
Следующее
От: Samuel Gendler
Дата:
Сообщение: Re: a strange order by behavior