The Title table have all the titles that need to be in the output, so if a title is not in the TitleDetailsRequest table (i.e. Title3) the output should just display "0". Curently there are 30 titles in the Title table but the users can add new titles so hardcoding the titles into columns will not be an option considering that the users can also add new titles.
Your help with regards to this matter will be greatly appreciated.