Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALTER VIEW [dbo].[vwDealHistoryPITA]
- AS
- SELECT ROW_NUMBER() OVER (PARTITION BY cm.CodeMasterID ORDER BY cm.CodeMasterID, cm.LastUpdateDate) AS Deal_HistoryID,
- cm.CodeMasterID,
- cm.ProjectName,
- cm.[Status],
- d.CompanyID,
- d.DealTypeMasterID,
- cm.[Description],
- d.PassiveInd,
- d.ApproxTPGOwnership,
- d.NumberBoardSeats,
- d.FollowonInvestmentInd,
- d.SocialImpactInd,
- d.EquityInd,
- d.DebtInd,
- d.RealEstateInd,
- d.TargetPctgReturn,
- d.ApproxTotalDealSize,
- cm.CurrencyCode,
- d.ConflictCheck,
- cm.CreatedDate,
- cm.CreatedBy,
- cm.LastUpdateDate,
- cm.LastUpdateBy,
- d.ExpensesExceedThresholdDate,
- d.CurrentTPGCheckSize,
- d.PreferredEquityInd,
- d.ConvertibleDebtInd,
- d.OtherRealAssetsInd,
- d.InitialTPGCheckSize,
- d.DirectLendingInd,
- cm.NameApproved,
- cm.FolderID,
- cm.CodaProcessedDateTime,
- cm.DeadDate,
- d.SectorMasterID,
- d.DTODataCompleteDate,
- cm.ValidFrom AS CodeMasterValidFrom,
- cm.ValidTo AS CodeMasterValidTo,
- d.validFrom AS DealValidFrom,
- d.validTo AS DealValidTo
- FROM dbo.CodeMaster FOR SYSTEM_TIME ALL cm
- INNER JOIN dbo.Deal FOR SYSTEM_TIME ALL d ON cm.CodeMasterID = d.CodeMasterID;
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement