I have one table, PEOPLE, with names
id nameLast nameFirst
000003 Sherwood Hugh
000004 Walter Wolfgang - 01
000005 McFadden Bruce - 01
000006 Power Des
another table, TELE_LINK, with phone numbers and emails
idPerson idTeleType useAreaCodeFormat numberOrAddress
000003 01 -1 2505463008
000003 03 -1 2505425276
000011 01 -1 2062921428
000011 02 -1 2062921426
000012 01 -1 6048829663
000012 02 -1 6048829669
idfTeleType represents what type it is - home phone, office phone, fax, email, etc.
I need to make a query which would show all phones and email in one row for one each person -
First Name Last Name Company Phone Home Phone Other Phone Mobile Fax Email
and put NULL or empty cell if record (tel. number or email) doesn't exist
I tried to do it for emails (TELE_LINK.idTeleType="10") only but is only shows records if email exists
SELECT PEOPLE.nameLast, PEOPLE.nameFirst, TELE_LINK.numberOrAddress
FROM TELE_LINK RIGHT JOIN PEOPLE ON TELE_LINK.idPerson = PEOPLE.id
WHERE (((TELE_LINK.idTeleType)="10"));
any idea please?
id nameLast nameFirst
000003 Sherwood Hugh
000004 Walter Wolfgang - 01
000005 McFadden Bruce - 01
000006 Power Des
another table, TELE_LINK, with phone numbers and emails
idPerson idTeleType useAreaCodeFormat numberOrAddress
000003 01 -1 2505463008
000003 03 -1 2505425276
000011 01 -1 2062921428
000011 02 -1 2062921426
000012 01 -1 6048829663
000012 02 -1 6048829669
idfTeleType represents what type it is - home phone, office phone, fax, email, etc.
I need to make a query which would show all phones and email in one row for one each person -
First Name Last Name Company Phone Home Phone Other Phone Mobile Fax Email
and put NULL or empty cell if record (tel. number or email) doesn't exist
I tried to do it for emails (TELE_LINK.idTeleType="10") only but is only shows records if email exists
SELECT PEOPLE.nameLast, PEOPLE.nameFirst, TELE_LINK.numberOrAddress
FROM TELE_LINK RIGHT JOIN PEOPLE ON TELE_LINK.idPerson = PEOPLE.id
WHERE (((TELE_LINK.idTeleType)="10"));
any idea please?