Re: Error with DISTINCT and AS keywords - Mailing list pgsql-sql

From Achilleus Mantzios
Subject Re: Error with DISTINCT and AS keywords
Date
Msg-id Pine.LNX.4.44.0207101525330.23339-100000@matrix.gatewaynet.com
Whole thread Raw
In response to Error with DISTINCT and AS keywords  (Andreas Schlegel <schlegel@software.b.uunet.de>)
Responses Re: Error with DISTINCT and AS keywords
List pgsql-sql
On Wed, 10 Jul 2002, Andreas Schlegel wrote:

> Hi,
> 
> I need some help to let this sql statement run with Postgres 7.2.1
> 
> Doesn't work:
> select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel;
> ERROR:  Unable to identify an ordering operator '<' for type 'unknown'
>          Use an explicit ordering operator or modify the query

Do it as

select DISTINCT tnr, titel, 'TEST'::text AS testcol from tTitel;

> 
> If I remove the DISTINCT keyword it works:
> select tnr, titel, 'TEST' AS testcol from tTitel;
> 
> 
> 
> Greetings,
> Andreas
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

-- 
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com       mantzios@softlab.ece.ntua.gr



pgsql-sql by date:

Previous
From: Dirk Lutzebaeck
Date:
Subject: How to get total number of rows when using LIMIT/OFFSET?
Next
From: Tom Lane
Date:
Subject: Re: Help with function optimisation