Advertisement
Guest User

truiz

a guest
Apr 27th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. SELECT --*
  2. 'ARXEION',
  3. document.archive_id,
  4. to_char(document.data_creation, 'YYYY') as ANNO,
  5. to_char(document.data_creation, 'MONTH') as MESE,
  6. document.document_guid,
  7. document.file_name,
  8. CASE WHEN attachment.attachment_file_name IS NULL THEN NULL ELSE 'ATTACHMENTS' END AS ATTACHMENTS,
  9. attachment.attachment_file_name,
  10. archive_name,
  11. archive_location
  12. FROM
  13. archive INNER JOIN document ON archive.id = document.archive_id
  14. LEFT OUTER JOIN document_in_attachment ON document.id = document_in_attachment.document_id
  15. LEFT OUTER JOIN attachment ON attachment.id = document_in_attachment.attachment_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement