SELECT SCHD2_REF,SCHD2_DATE,SCHD2_REC_TYPE,(SCHDQTY_REQ - SCHDQTY_ISS) AS QTYOUT
AND SCHDQTY_REQ > SCHDQTY_ISS
ORDER BY 2;
I need to be able to change the QTYOUT and SUGGQTY_REQ values based on the SCHD2_REC_TYPE and SUGG2_REC_TYPE fields. There anyway to do this right in the sql or do i have to created some kinda outside procedure.
I would just do this with my scripts afterward. But the circumstances restrict me.
either that or have an additional column that somehow is autoassigned an identifier number to determine where that data came from and then process everything on the scripting side per row.
try with the CASE which is similar to DECODE with additional feature.
Here is the example:
select deptno,comm,(case when (deptno=10 or comm is null ) then 'test case' else 'test' end) from emp order by 2,1;
here the o/p will be
deptno comm case
10 test case
20 test case
10 800 test case
20 300 test
hope u got the point.
Srinivas Reddy Tatireddy
thanks man i appreciate it. hopefully this will do the trick =)
Click Here to Expand Forum to Full Width