Skip to content
Advertisement

specific select within sql server

I have a table vbap : For all distinct POSNR, PARVW, I need to check if POSNR=POSNR2, if it’s the case I select KUNNR. if POSNR<>POSNR2 and POSNR2 =’00000′ I select KUNNR Result: I didn’t …

How to SUM multiple DECODE values?

I have the following decodes in my SELECT case: DECODE (table_name, ‘RECHNUNG’, SUM(beleg_betrag_offen) ) as re_be_of, DECODE (table_name, ‘GUTSCHRIFT’, SUM(beleg_betrag_offen) ) as gs_be_of, DECODE (…

Replace text from VIEW Definition

I have the following VIEW definition: create view v_1 as select * from t1 where [date] between ‘2010-01-01’ and ‘2019-01-01’ union all select * from t2 where [date] between ‘2012-01-01’ and ‘2019-01-…