Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: how many people have more than 2 cars
"Ben Thomas" <bthomas_at_strider.localdomain> honoured comp.databases.oracle.server on Wed 25 Apr 2001 01:58:39p with <9c7dq1$2kip$1_at_allthetime.news.cais.net>:
> I ask this question by example:
>
> {table1}:
> person_id
>
> {table2}:
> person_id
> car_id
>
> each person has one entry in {table1} and zero, one or more entries in
> {table2}.
>
> I want to know how may people have more than 2 cars.
> Seems easy but I am missing something.
>
>
> help?
> Much thanks in advance.
>
> Ben
>
check out the HAVING, GROUP BY and COUNT() clauses in a SELECT Received on Thu Apr 26 2001 - 04:08:32 CDT