one more problem. I need your help.
Make a list of medications that have been entered as the same (identical_with) but differ in their association with the disease.
I don't know how to do that.
The result should be in that case:
one more problem. I need your help.
Make a list of medications that have been entered as the same (identical_with) but differ in their association with the disease.
I don't know how to do that.
The result should be in that case:
To solve your problem, you need to use twice the table association. Following code should be OK:
select
i.Name_1, i.Name_2
from
association a
inner join
identical_with i
on i.Name_1 = a.Name
inner join
association a2
on i.Name_2 = a2.Name
where
a2.Fachname <> a1.Fachname
This is a bit long for a comment, although the answer is essentially "you can't do this in MySQL".
The support you are looking for is for hierarchical or recursive queries. Almost every databases except MySQL has built-in support for these types of queries. This leaves you with essentially four choices:
Unfortunately, the last two methods require triggers to maintain the data structure of inserts, updates, and deletes.