I need an JPA/SQL expert: EXISTS query on an Inner Join returns wrong result
问题 I have three tables and want to: Select all students from the first table, that have at least one connection to the school in district '999' in the second table and at least one connection to the teacher with social_number '101' and at least one to the teacher with number '103' in the third table. The tables are connected through the second table. I created an online sql compiler to show the problem: http://tpcg.io/FIoO79xi This query works fine and as expected, until I add the third EXISTS