Hi All
I have a contacts system that has four tables, Names, address, phonenumber, email. The last three have a nameFK foreign key that joins with the names table. I designed it this way so I could have multiple entries of each time of contact info. I have two rows in address, three rows in phonenumber and two rows in email. I am trying to create a query that will give me three rows (rows in phonenumber). What I am getting is 18. Is there a way to do this or am I going to need to redesign the tables. I am using Syabase ASA database.
Here is my Query. Thanks.
select *
from names na
left outer join address ad
on ad.namefk = na.namepk
left outer join email em
on em.namefk = na.namePK
left outer join phonenumber ph
on ph.namefk = na.namePK
where na.namepk= 1