I am trying to select CONTACTS in my MySQL table, that does NOT have any associated information in the INVESTMENTS table.
I have a query that is something like this, but it's not pulling all my contacts properly.
TL;DR Select ALL contacts, then remove all contacts that have investments
SELECT
*
FROM
contacts
INNER JOIN investments ON investments.contactId = contacts.contactId
WHERE
contacts.userId = '1'
AND contacts.trash IS NULL
AND NOT EXISTS ( SELECT * FROM investments WHERE investments.company IS NULL )
GROUP BY
contacts.contactId
Any help would be greatly appreciated.