Skip to content
Advertisement

Unexpected database output when using INNER JOIN

I have the following SQL query

But I think that something is wrong with that.

For example:

If I put three in the RAUMKLASSE_ID textfield in the browser and invoke my method it returns only one room. But there are six rooms with that ID. The strange thing is, that if I remove the two INNER JOIN and the second line of my SELECT, like this:

it is returning the six rooms, which is correct. I don’t know what the problem is with my query. Maybe someone can help me with that?

Thanks in advance

Advertisement

Answer

This is the expected behaviour, since:

Will get you only the rooms that are found in the tables RAUM, RAZUORDNUNG and RAUMATTRIBUTE tables, removing these INNER JOINs will get you all the rooms from the RAUM table that satisfy your condition, check these pages for more details about JOINs:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement