6.4 allows to use ORDER BY with a column that does not appear
in a target list. This is great. However, following result seems
strange to me. Sometimes DISTINCT does not remove duplication.
Is this normal behavior?
create table dtest (i text, j date, k int);
CREATE
insert into dtest values ('a', '1998/12/1', 1);
INSERT 215243 1
insert into dtest values ('a', '1998/12/2', 2);
INSERT 215244 1
insert into dtest values ('a', '1998/12/3', 3);
INSERT 215245 1
select * from dtest;
i| j|k
-+----------+-
a|12-01-1998|1
a|12-02-1998|2
a|12-03-1998|3
(3 rows)
select distinct i from dtest;
i
-
a
(1 row)
select distinct i from dtest order by j;
i
-
a
a
a
(3 rows)
select distinct i from dtest order by k;
i
-
a
a
a
(3 rows)
--
Tatsuo Ishii
t-ishii@sra.co.jp