Skip site navigation (1) Skip section navigation (2)

ordering error in query?

From: s <smarie(at)ekno(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: ordering error in query?
Date: 2002-06-26 17:50:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
I am trying to keep my select statements compatible for running on
oracle or postgres.  I ran into a problem with a query that is part of
a union.  The original query clause is of the form:

select distinct, '' from foo f;

I need the empty string as the second attribute because the first part
of the union has a second attribute.  This works on oracle, but
postgres says:

ERROR:  Unable to identify an ordering operator '<' for type 'unknown'
        Use an explicit ordering operator or modify the query

If I get rid of 'distinct' postgres responds, but I don't get the
result I want.  If I type 

select distinct s.ben, cast ('' as varchar) from sitealertsview s;

I get the result I want, but it's not compatible with oracle.  




Lonely Planet's ekno - more than a phonecard
Get ekno before you go!


pgsql-general by date

Next:From: Bruce MomjianDate: 2002-06-26 17:54:47
Subject: Re: Shared Memory Sizing
Previous:From: Alvaro HerreraDate: 2002-06-26 17:49:38
Subject: Re: How to run multi-processor question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group