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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Simple Query?

Re: Simple Query?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 29 May 2001 11:23:17 +0200
Message-ID: <th6qg3qre4l96f@beta-news.demon.nl>

"jop" <jop_at_novabase.pt> wrote in message news:jQIQ6.5963$gR.18202769_at_newsserver.ip.pt...
> I do I select all the customers from the same city?
> I thought it would be like this:
>
> SELECT C.Name, C.City
> FROM Customer C, Customer Ca
> WHERE C.City = Ca.City
>
> But I get an unexpected result.
>
>
>

select c.name, c.city
from customer c
where c.city = '<city name>'

or
select c.name, c.city
from customer c
order by c.city

Your query will result in a so-called cartesian product (you get all m times n combinations)
You might want to consider buying the book of Rick van der Lans on SQL the structured query language available at Amazon, first published in 1986 and still reprinted, originally Dutch.

Hth,

Sybrand Bakker, Oracle DBA Received on Tue May 29 2001 - 04:23:17 CDT

Original text of this message

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