Hey guys. I'm not familiar using joins. So I'm hoping you guys could help me.
This is the select statement:
SELECT
organization.*,
contactdetails.*,
ringeliste.ringelisteStatus, ringeliste.notat
FROM organization
INNER JOIN contactdetails ON organization.OrgID = contactdetails.orgID
INNER JOIN ringeliste ON organization.OrgID = ringeliste.orgID
WHERE ringeliste.empID ='54001'
AND ringeliste.status <> "Ringt";
The output is:
| Company 1| Telephone num | Contact person | Status|
| Company 2| Telephone num | Contact person | Status|
| Company 3| Telephone num | Contact person | Status|
This is correct... as long as each company only has 1 contactperson.
If I add e.g. 2 more contactpersons for a company (contactdetails table gets 2 more entries) - the output is increases by two!!!!
Even if a company had 10 contacts, the output should only be 3!
Why is this happening??