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: Thanks ALEX Filonov

Re: Thanks ALEX Filonov

From: Alex Filonov <afilonov_at_pro-ns.net>
Date: Sat, 25 Mar 2000 04:04:05 GMT
Message-ID: <8bhdrf$dl5$1@nnrp1.deja.com>


In article <ObcC4.6597$5b5.218297_at_news2-win.server.ntlworld.com>, "Mark Thomas" <mark.thomas5_at_dtn.ntl> wrote:
> thankyou very much for your help - it did the trick
>
> hope you will not mind answering one more for me - i really would
appreciate
> it
>
> question
>
> the names, addresses and postcodes of customers who have hired each
make of
> car?
>
> there are 3 makes of car jaguar vauxhall and ford
> when i run the below the computer produces a result of zero.
> i have been told that in my query that it doesn't search 3 times per
> customer and therefore doesn't pick up on my data. - i hope that sort
of
> makes sense.
>
> my input is
>
> select distinct customer.name, customer.address, customer.post_code
> from customer, car_type, hiring, car
> where customer.acc_no = hiring.cust_acc
> and hiring.regno = car.regno
> and car.model = car_type.model
> and maker = 'Ford'
> and maker = 'Jaguar'
> and maker = 'Vauxhall';
>
> thanx in advance
>
> mark
>
>

select distinct maker, customer.name, customer.address,

                customer.post_code

from customer, car_type, hiring, car
where customer.acc_no = hiring.cust_acc and hiring.regno = car.regno
and car.model = car_type.model
and maker in ('Ford', 'Jaguar', 'Vauxhall') group by maker
order by maker, customer.name;

In sqlplus you can also print make only once using command

break on maker

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Mar 24 2000 - 22:04:05 CST

Original text of this message

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