I have 5 tables on my system:
pacientes - Primary key idPacientes
anamnese - foreggin key idPacientes
avaliacoes - foreggin key idPacientes
intervencao - foreggin key idPacientes
contrato - foreggin key idPacientes
The pacientes
table has the primary key called idPacientes
, the rest have foreign keys connected to the patient.
I am making a report for when I finish registering, doing anamnesis, evaluating, intervening with the patient and giving his contract, I pull all the information that is in anamnese
, avaliacoes
, intervencao
% of the patient.
But I do not know how to make a% of it. My teacher helped me by giving an example, but that only takes the patient's information and anamnesis:
SELECT PAC., FIC.
FROM PACIENTES AS PAC INNER JOIN anamnese AS FIC ON PAC.idPacientes=FIC.idPacientes
where pac.idPacientes = '$id'
Where contrato
and select
are written the aliases of the PAC
and FIC
tables. I want to have the same thing as this pacientes
, but include the rest of the tables.