Skip to content
Advertisement

SQL many joins many to many

I have 5 tables:

Table Reports

Many to many table ReportsIpRel

Table of InfoProviders

Many to many table QueriesIpRel

And table of Queries

The SELECT I am trying to achieve is the following:

I tried many left/inner joins like this:

but all for nothing.

I have to use where condition: WHERE report_Id = ‘2’ /EXAMPLE

I’m trying to do this in ms SQL in SQL Server Management Studio.

Thank you in advance

Advertisement

Answer

Please try this query its working for me in SQL server:

Demo

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