Re: Error with DISTINCT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Error with DISTINCT
Дата
Msg-id 20139.969027199@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Error with DISTINCT  (Jerome Raupach <jraupach@intelcom.fr>)
Список pgsql-sql
Jerome Raupach <jraupach@intelcom.fr> writes:
> testdb=#SELECT DISTINCT table_2.f1, table_1.f2, '2000-08-22' AS
> testdb-#date FROM table_1, table_2 WHERE table_1.f1 = table_2.f1;
> ERROR:  Unable to identify an ordering operator '<' for type 'unknown'
>         Use an explicit ordering operator or modify the query

> Is it a bug ?

No, I don't think so.  The system has no way to intuit what datatype
you consider '2000-08-22' to be.

SELECT DISTINCT table_2.f1, table_1.f2, '2000-08-22'::date ...

would work.
        regards, tom lane


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

Предыдущее
От: "Rommel B. Abaya"
Дата:
Сообщение: Re: get table schema in psql?
Следующее
От: "Stuart Foster"
Дата:
Сообщение: Where to get benchmark testing