I have the following tables with data:
Projects table:
ProjID Name
1 A
2 B
Project Tags table:
ProjID TagID
1 1
2 2
2 3
Tags Metadata table:
TagID TagName
1 Series:Go
2 Series:Exploring
3 Chapter:01
- The
ProjIDfild in "Project Tags Table" is foreign key toProjIDfield in "Projects table". - The
TagIDfield in "Project Tags Table" is foreign key toTagIDfield in "Tags Metadata table".
Here, projects have tags which are of two types: Series and Chapter. I need and SQL query to return a custom table associating the Series and Chapter tag names mentioned in the Tags Metadata Table to the respective projects in the Projects Table.
The final table should look like this:
ProjID Name Series Chapter
1 A Series:GO null
2 B Series:Exploring Chapter:01