Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> query performance
Hi All
i have one query
i have information about some people , these people have mulitple addresses(2-4) and multiiple phone numbers(3-10).
I have created table like following
people_table
peopleid , name , age , profession , sex
Address_table
address_Id,peopleid , address
phone_number_table
phone_number_Id,
peopleid , phone
The problem is that if i want to know the information about people with name "john"
then i have to run many queries
first query is
select peopleid , name , age from people_table;
second query
in loop according to the rslt obtained
select address from Address_table where peopleId = ID_OBTAINED
third query.. again in loop
select address from phone_number_table where peopleId = ID_OBTAINED
Is there any better for solving my problem. I think my db design or way of querying is poor.
thnx
Raan
Received on Sun Oct 21 2007 - 21:27:55 CDT