View: vendor_payment_export_view

Columns
  Column Name Data Type
1.   fin_document_key decimal(15)
2.   fin_document_detail_key decimal(15)
3.   included_fin_document_key decimal(15)
Table/Column Dependencies
Table Column
fin_document_detail fin_document_detail_key
  fin_document_key
vendor_payment fin_document_key
vendor_payment_included fin_document_key
  included_fin_document_key
SQL Server Create Statement
create view vendor_payment_export_view as
select
   fdd.fin_document_key fin_document_key,
   fdd.fin_document_detail_key fin_document_detail_key,
   null included_fin_document_key
from fin_document_detail fdd
join vendor_payment vp on vp.fin_document_key = fdd.fin_document_key
union all
select
   fin_document_key,
   null  fin_document_detail_key,
   included_fin_document_key
from vendor_payment_included