USE [SISIMPU];
GO


SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE VIEW [Transaction].View_Publications
AS
	SELECT
		*
	FROM
		[Transaction].View_Finalitations AS a LEFT JOIN
		[Transaction].Publications AS B ON a.FinalitationId = b.PublicationFinalitationId
	WHERE
		(a.RegulationStep = 19 AND RegulationStepStatus = 6)
		OR a.RegulationStep > 22
GO