How about, good afternoon.
I have a database with 4 tables that are linearly related. To which I enter data that depend on different precedents.
I have the following diagram which I enter into the base.
In it you can see that the letter "I" is only for "E of J". However, in my query it shows me that "I" has all the other activities.
This is the code I use to make the query.
SELECT PAPA.idPAPA PAPA,HIJO.idHIJO HIJO,NIETO.idNIETO
NIETO,BISNIETO.idBISNIETO BISNIETO
FROM PAPA,HIJO,NIETO,BISNIETO
WHERE HIJO.PreH=idPAPA
AND NIETO.PreN=HIJO.idHIJO
AND (BISNIETO.PreB=NIETO.idNIETO OR NIETO.PreN=HIJO.idHIJO)
;
I would like to know how I can exclude the "I" from the other activities in my query. As follows: