Querrying mysql with a bridge table

I have a database scheme like this:

enter image description here

All I want is to query data from these tables where the one in the middle is a bridgetable.

I want to write a query to get Details from WrapupCodes table for all the WrapupIds that exists in Bridgetable for the same contactId as in CallDetails table.

e.g:

enter image description here

Similarly this is the table I want to get details from

enter image description here

And here is the main table.

enter image description here

thanks in advance.

Add Comment
1 Answer(s)

It is very basic SQL:

SELECT * FROM WrapupCodes w INNER JOIN Contact_Wrapup c ON c.WrapupID = w.WrapupID INNER JOIN CallDetail d on d.ContactID = c.ContactID 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.