
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[EmisjeReklamy]
AS
SELECT 
U.Id AS EmisjaId,
R.ReklamaId,
R.idZamowienia AS ZamowienieId,
N.TYT AS Tytul,
N.NRW AS NrWydania,
N.DATA_W AS DataEmisji
FROM [Ukaże się w nr] U 
LEFT OUTER JOIN Reklama R ON U.ReklamaId = R.ReklamaId
LEFT OUTER JOIN NR N ON N.TYT=R.[Tytuł] AND N.NRW=U.[Nr Wydania]
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

