Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Subselect in SELECT
simply try adding a comma after persons.name and put the amount alias
after the closing brace of the subquery, you want to use amount
synonymous for the subquery, not as a qualifier within it. The way you
coded it, the scope of amount is simply limited to the subquery, thus
you can't use it in the from clause of the query.
chers, gerald
On 20 Jan., 17:12, Matthias Matker <kernkoe..._at_arcor.de> 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
Received on Mon Jan 22 2007 - 13:38:09 CST
![]() |
![]() |