Re: [SQL] Alias-Error

From: Richard Huxton <dev(at)archonet(dot)com>
To: jrichstein(at)softdecc(dot)com, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Alias-Error
Date: 2003-10-21 19:02:04
Message-ID: 200310212002.04344.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Tuesday 21 October 2003 08:17, Jost Richstein wrote:
> Ok. The exact error message is as follows:
>
> SQLException Time : Mon Oct 20 13:15:25 CEST 2003
> SQLException ErrorCode : 0
> SQLException SQLState : null
> SQLException Message : ERROR: Relation "c2" does not exist
> SQLException Connection: 4878867
>
> The query is something like this:
>
> SELECT DISTINCT C2.cmc_mchap, C2.cmc_sort
> FROM sis_cmca, sis_cmca C2
> WHERE cm_status != 'U' AND sis_cmca.cmc_name='INTERN2000' AND
^^^^^^^^^
You're missing a table name here. It could be PG is reporting the wrong error.

> C2.cmc_name='INTERN2000' AND sis_cmca.cmc_mchap=C2.cmc_mchap

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2003-10-21 19:40:08 max() over some rows but grouped, within one view def - how ?
Previous Message Terry Yapt 2003-10-21 18:59:19 Re: Simple SQL

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-10-21 19:08:39 Re: function problem
Previous Message Richard Huxton 2003-10-21 18:59:18 Re: Writing the SQL queries inside Functions and operators