Skip to content
Advertisement

Multiple ids in a unique column each and joining them to get details of each on the same line

I’m having in one table a master_id, and student_id. I want to write a query that would print out both the names of the master and student on the same line while joining their details from another table.

master student table

assignments table

So I’m trying to write a query that would return the results from the assignment table like

Results

I’ve tried this query but I’d need help to complete it.

Advertisement

Answer

I suspect you just want two joins:

Note: from and to are really, really bad column names because they are SQL keywords.

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