Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Simple Query?
"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
![]() |
![]() |