View Single Post
Old 02-01-2005, 07:49 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,503
sde is on a distinguished road
Code:
SELECT C.CONTACT_ID, P.PHONENR_ID, P.PHONETYPE_ENUMID
  FROM CONTACT AS C
  LEFT JOIN CONTACTPHONENR AS CP ON C.CONTACT_ID=CP.CONTACT_ID
  LEFT JOIN PHONENR AS PN ON CP.PHONENR_ID=PN.PHONENR_ID
  WHERE PN.PHONETYPE_ENUMID=4
    AND C.CONTACT_ID=20057
i'm just guessing here, but if that doesn't work, maybe add a 'GROUP BY C.CONTACT_ID'

i'm not sure. if you find the answer, i'd be interested to know what works.


from contact co ,
contactphonenr mobilecoph left join phonenr mobilephone on
mobilephone.phonenr_id = mobilecoph.phonenr_id and mobilephone. and co.CONTACT_ID = mobilecoph.contact_id
__________________
Mike
sde is offline   Reply With Quote