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

enter image description here

Result:

enter image description here

I didn’t understand how to do it?

Advertisement

Answer

This seems like just a where cause:

Perhaps you are trying to prioritize the rows, to select one row per kunnr. If so:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement