Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Subselect in SELECT

Re: Subselect in SELECT

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 20 Jan 2007 17:00:51 -0800
Message-ID: <1169341245.883102@bubbleator.drizzle.com>


Charles Hooper wrote:

> Matthias Matker wrote:

>> Hello together,
>>
>> SELECT
>> persons.name
>> ( SELECT COUNT(*) amount FROM person_cds WHERE ( person_cds.pname= persons.name))
>> FROM
>> persons
>> WHERE ( amount< 280)
>> ORDER by persons.name;
>> EXIT;
>>
>>
>> I want the name of the persons ( name is primary key of persons), which have fewer cds than 280.
>>
>> After executing this query, I got the Message,
>>
>> "amount" invalied identifier.
>>
>> Can you explain me, why?
>>
>> Thanks
> 
> Quick check:
> SELECT
>   *
> FROM
>   V$RESERVED_WORDS
> WHERE
>   KEYWORD='AMOUNT';
> 
> (No rows)

On the other hand ... NAME ... is a reserved word so I wouldn't bet on "persons.name" if it were me.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sat Jan 20 2007 - 19:00:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US