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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: how many people have more than 2 cars

Re: SQL: how many people have more than 2 cars

From: Tweetie Pooh <tp601553_at_cia.gov>
Date: Thu, 26 Apr 2001 09:08:32 GMT
Message-ID: <Xns908F672D4E67BTweetiePooh@62.253.162.108>

"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

Original text of this message

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