Joining three tables in SQL -


I have three tables

  file - file ID (PK), code, & Amp; Description hierarchy - File ID (fk), Folder ID (FK), Folder's (PK) folder - Folder ID (PK), Folder Name   

In the hierarchy table, the file ID will be empty for the folder and the folder ID will be empty for a file

I do not get any results from this query

  SELECT File.fileId, File.code, File Description, Hierarchy.folderId, Hierarchy .folderKey, File.fileId = Hierarchy.fileId file from the hierarchy attached to the File Inner file. Include a folder on the hierarchy in the folder. Folder ID = Folder. Folder ID   

No clue << P>

Does this work?

  Add SELECT File.fileId, File.code, File.description, Hierarchy.folderId, Hierarchy.folderKey, from file to file folder. File = file on File = hierarchy.fileId folder on the left Join hierarchy. Folder = folder.foulder iid    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -