daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2. generatedFile.FileName AS "GeneratedFileName",
  3. ( SELECT Files.FileName
  4.   FROM Files
  5.   WHERE Files.Id = DocumentTemplates.FileId
  6. ) AS "InitialFileName",
  7. REPLACE(generatedFile.FileName,
  8. ( SELECT Files.FileName
  9.   FROM Files
  10.   WHERE Files.Id = DocumentTemplates.FileId
  11. ),'') AS "NeededName"
  12. FROM WorkDocuments
  13. JOIN DocumentTemplates ON WorkDocuments.SourceDocumentTemplateId = DocumentTemplates.Id
  14. JOIN Files generatedFile ON generatedFile.Id = WorkDocuments.FileId
RAW Paste Data
Top