954b8eb4-e2ee-44f0-8e05-535a891b19adBAZA_REKLAM29.7cmStringliczba_ogtruesortuj po: reklama_idliczba_ogdatanr_wydaniaStringtruetytułListaTytulowSYMBSYMBStringnr wydaniatrue21cm0.25cmtrue2.5cm2.5cm2.5cm0d754e4e-d550-4bb7-a1ab-4faa3a823e1b21cmreklamaIdSystem.Int32ID REKLAMYSystem.StringwyroznienieSystem.BooleanWyroznienie_exportedSystem.BooleanlogoSystem.BooleantytułSystem.Stringnumer wydaniaSystem.Int16REKLAMA_IDSystem.Stringliczba_ogSystem.Int32DATASystem.StringNR_WYDANIASystem.Int16BAZA_REKLAMSelect reklamaId, [ID REKLAMY],
wyroznienie,Wyroznienie_exported,logo,tytuł, [numer wydania],
[REKLAMA_ID],
'liczba_og' = case when [nr_wydania] is NULL then 0 else count(reklama_id) end,DATA,NR_WYDANIA from
(select R.ReklamaID,
R.[ID REKLAMY],
R.Wyroznienie,R.Wyroznienie_exported, R.logo, R.tytuł, U.[nr wydania] as [numer wydania]
, Og.[REKLAMA_ID],Og.ID, Og.DATA,Og.NR_WYDANIA from
dbo.REKLAMA R left join dbo.[UKAŻE SIĘ W NR] U
on r.reklamaId = U.reklamaId
full outer join
[DANE_OGL_SQL].dbo.DANE Og on R.[ID REKLAMY]=Og.[REKLAMA_ID]
where
((Og.[REKLAMA_ID] is not null and Og.[REKLAMA_ID]<>'') OR
(R.wyroznienie=1)) and R.tytuł =@tytul and U.[nr wydania]=@nrwydania ) T
group by ReklamaID, [ID REKLAMY], [Reklama_Id],wyroznienie,Wyroznienie_exported,logo,tytuł, [numer wydania],DATA,NR_WYDANIA order by liczba_og desc=Parameters!tytul.Value=Parameters!nrwydania.ValuetrueSYMBSystem.StringBAZA_REKLAMSELECT SYMB
FROM [LISTA TYTUŁÓW]
WHERE (st_aktywny = - 1)true19cm1cm