Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!easynews.com!easynews!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail
From: Aspeda <support@aspeda.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: How would I write this sql
Message-ID: <o2q2ev4hle636td0uq5e6k8lbbqsd7hiou@4ax.com>
References: <bbrj7t$599$1@bob.news.rcn.net>
X-Newsreader: Forte Agent 1.93/32.576 English (American) trialware
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 66
Date: Sat, 07 Jun 2003 03:58:45 GMT
NNTP-Posting-Host: 216.249.99.51
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread1.prod.itd.earthlink.net 1054958325 216.249.99.51 (Fri, 06 Jun 2003 20:58:45 PDT)
NNTP-Posting-Date: Fri, 06 Jun 2003 20:58:45 PDT
Organization: EarthLink Inc. -- http://www.EarthLink.net
Xref: core-easynews comp.databases.oracle.server:188955
X-Received-Date: Fri, 06 Jun 2003 21:00:16 MST (news.easynews.com)

On Fri, 6 Jun 2003 21:38:40 -0500, "Jake" <oracle-news@heyjay.com>
wrote:

>How can I write this sql?
>
>SQL> SELECT user.id
>  2  FROM   organization user
>  3  WHERE  userid = 'myname'
>  4  /
>SELECT user.id
>           *
>ERROR at line 1:
>ORA-00923: FROM keyword not found where expected
>
>I'm not able to change the table alias.  And I know the error is from "user"
>being a pseudo column.
>
>but is there some sort of quoting, or something I could do, and leave the
>table alias?
>
>Thanks
>Jay
>

If you can't change the alias ... then here's one way that I was able
to make it work (requires adding double-quotes):

SQL> select user.id
  2  from (select 1 id from dual) user
  3  where 1=1;
select user.id
           *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected


SQL> ed
Wrote file afiedt.buf

  1  select "user".id
  2  from (select 1 id from dual) user
  3* where 1=1
SQL> /
from (select 1 id from dual) user
                             *
ERROR at line 2:
ORA-00933: SQL command not properly ended


SQL> ed
Wrote file afiedt.buf

  1  select "user".id
  2  from (select 1 id from dual) "user"
  3* where 1=1
SQL> /

        ID
----------
         1


Regards,
Vitaliy
DBAToolZ.com (free sql scripts + SQLDIR parser)
Aspeda.com   (free Oracle monitoring tool)
