Here is an example: http://guelphdad.wefixtech.co.uk/sqlhelp/catsubcat.shtml
select the content from the three table, and write an IF condition inside the while function,
to check if the previous row has the same value (contactId) , if not print the next row.
Your query would be more difficult then a simple triple JOIN if you concated the category names as you think.
Relational table should can be having zero
If one or more company hasn't got a category then you didn't need to insert in the relative_groups table.
And then the query looks like this:
SELECT
`master_contacts`.`contactId` , `master_contacts`.`contactName` , `master_contacts`.`contactCompany` , `groups`.`groupId` , `groups`.`groupName`
FROM
((`master_contacts` LEFT JOIN `relative_groups` ON ((`master_contacts`.`contactId` = `relative_groups`.`contactId`))) LEFT JOIN `groups` ON ((`relative_groups`.`groupId` = `groups`.`groupId`)))
GROUP BY
`master_contacts`.`contactId`, `master_contacts`.`contactName`, `master_contacts`.`contactCompany`, `groups`.`groupName`
Hello, jjozsi.