[Solved] Three joined tables query with many-to-many relationship in JPA [closed]


I think your SQL might look something like this:

SELECT * FROM Hospital WHERE Postcode = 3000 AND
Hospital_id IN
    (SELECT Hospital_id FROM Hospital_Medical hm
    INNER JOIN Medical_Service m ON hm.Medical_id = m.Medical_id
    where Medical_name="Emergency") AND
Hospital_id IN
(SELECT Hospital_id FROM Hospital_Language hl
    INNER JOIN Language_Service l ON hl.Language_id = l.Language_id
    where Language_name="English")

solved Three joined tables query with many-to-many relationship in JPA [closed]