I have 3 tables where the first is of notes that users are registering
and the other one is from registered companies
and the last of registered users by companies
My intention is for the query to obtain the data from the user tables (company and users) with the ids of the first table NOTES. This is my query:
SELECT notas.*,
empresa_usuarios_data.nombres_us,
empresa_usuarios_data.apellidos_us,
empresa_data.avatar AS avatarEmpresa,
empresa_usuarios_data.avatar AS avatarUsuarios
FROM notas
INNER JOIN empresa_usuarios_data ON empresa_usuarios_data.id_user = notas.id_user
INNER JOIN empresa_data ON empresa_data.id_empresa = empresa_usuarios_data.id_empresa
WHERE notas.id_empresa = 3
But the problem as you see is that the column id_user of the first table Notes, there are records with the number 0 that are the companies, but this 0 is not registered in any of the two tables.
and for this reason does not return these records with the number 0 , and I want to obtain them.
How could I change my query to include these records with the number 0