Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- Table1.*,
- case
- when Table1.KSCHL = 'Y'
- then Table1.KBETR
- else
- Table1.KBETR * t2.KBETR
- end as Expected
- from Table1
- left join Table1 as t2
- on Table1.matnr = t2.matnr and
- Table1.werk = t2.werk and
- t2.kschl = 'Y';
Add Comment
Please, Sign In to add comment