pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedError with DISTINCT
3+ messages / 3 participants
[nested] [flat]
* Error with DISTINCT
@ 2000-09-15 09:03 Jerome Raupach <jraupach@intelcom.fr>
2000-09-15 14:13 ` Re: Error with DISTINCT Tom Lane <tgl@sss.pgh.pa.us>
2000-09-15 21:36 ` Re: Error with DISTINCT Jie Liang <jliang@ipinc.com>
0 siblings, 2 replies; 3+ messages in thread
From: Jerome Raupach @ 2000-09-15 09:03 UTC (permalink / raw)
To: pgsql-sql
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
I must execute this query :
testdb=#SELECT table_2.f1, table_1.f2, '2000-08-22' AS date FROM
testdb-#table_1, table_2 WHERE table_1.f1 = table_2.f1 GROUP BY
testdb-#table_2.f1, table_1.f2;
Is it a bug ?
Thanks in advance.
Jerome.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error with DISTINCT
2000-09-15 09:03 Error with DISTINCT Jerome Raupach <jraupach@intelcom.fr>
@ 2000-09-15 14:13 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2000-09-15 14:13 UTC (permalink / raw)
To: Jerome Raupach <jraupach@intelcom.fr>; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error with DISTINCT
2000-09-15 09:03 Error with DISTINCT Jerome Raupach <jraupach@intelcom.fr>
@ 2000-09-15 21:36 ` Jie Liang <jliang@ipinc.com>
1 sibling, 0 replies; 3+ messages in thread
From: Jie Liang @ 2000-09-15 21:36 UTC (permalink / raw)
To: Jerome Raupach <jraupach@intelcom.fr>; +Cc: pgsql-sql
Hi,
try this:
testdb=#SELECT DISTINCT table_2.f1, table_1.f2, date('2000-08-22') AS
testdb-#date FROM table_1, table_2 WHERE table_1.f1 = table_2.f1;
Jerome Raupach wrote:
> 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
>
> I must execute this query :
>
> testdb=#SELECT table_2.f1, table_1.f2, '2000-08-22' AS date FROM
> testdb-#table_1, table_2 WHERE table_1.f1 = table_2.f1 GROUP BY
> testdb-#table_2.f1, table_1.f2;
>
> Is it a bug ?
> Thanks in advance.
>
> Jerome.
--
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang@ipinc.com
www.ipinc.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2000-09-15 21:36 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-15 09:03 Error with DISTINCT Jerome Raupach <jraupach@intelcom.fr>
2000-09-15 14:13 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-09-15 21:36 ` Jie Liang <jliang@ipinc.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox