Skip to content
Advertisement

SQL many to many

I have fivetables here:

User

subject_id

batch

subject_batch

subject_assessment

The SELECT that i am trying to achieve is

I tried =

but fail. It works when i remove

and

But then i wouldnt be able to retrieve subject_id and subject_name.

Appreciate if you could help.Thank you in advance.

Advertisement

Answer

Here is how it should look like:

Here is where you can run it:

https://paiza.io/projects/RtN8fMS1vVlQ2mtEYpqf7g?language=mysql

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