Re: sqlplus query problem where table name = column name

From: Avi Abrami <aabrami_at_intersystemsww.com>
Date: Wed, 29 Nov 2000 07:48:46 +0200
Message-ID: <3A2498BE.E7533655_at_intersystemsww.com>


hebertm_at_my-deja.com wrote:

> I'm using the sqlplus client that comes with Oracle8i Enterprise Edition
> Release 8.1.6.0.0 - Production", and I'm seeing an odd problem. I'm not
> that experienced with sql, I'm sure there's an easy way around this.
>
> I'm trying to specify a field in the where clause, in which the table
> name and column name are equal, e.g. "where base_site.site_name =
> site_name.site_name". That query results in an "invalid column" error
> message, even though there indeed is a column called site_name in the
> table site_name.
>
> Any idea how to get around this?
>
> Thanks,
> Marc
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Hi Marc,
It would help to see your entire SQL query text. This means I have to make a guess. My guess is that your FROM clause only contains the 'base_site' table. It needs to also contain the 'site_name' table. Example:

SELECT b.site_name
FROM base_site b,

      site_name s
WHERE b.site_name = s.site_name

Cheers,
Avi. Received on Wed Nov 29 2000 - 06:48:46 CET

Original text of this message