Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Subselect in SELECT
John K. Hinsdale schrieb:
> Matthias Matker wrote:
> The preferred way in SQL to express your desired result is something > like: > > SELECT P.name, count(*) AS no_of_cds > FROM persons P, person_cds PC > WHERE P.name = PC.pname > GROUP BY P.name > HAVING count(*) < 280 > ORDER BY P.name >
Thanks, but what is wrong in my "solution"?
My only problem is to get the value of
( SELECT COUNT(*) amount FROM person_cds WHERE ( person_cds.pname= persons.name))
to be stored as "amount"
in
SELECT
persons.name ( SELECT COUNT(*) amount FROM person_cds WHERE ( person_cds.pname= persons.name)) FROM persons
and why occurs this error and have to make my solution running well?
Matze Received on Sat Jan 20 2007 - 11:23:11 CST