SQL query to get full hierarchy path from different tables
问题 This is very relevant to the question SQL query to get full hierarchy path. The only difference is that my hierarchy contains different entity types from different tables, for example: Project Phase Folder Document I want to select all documents along with their full paths (from poject level to folder level). Phases and folders can have subphases and folders. I'm horrible at SQL and just can't figure out how to adapt the answer to the linked question to suit my needs. Data model and example