Im not sure where to post this but here is the closest match I can find.
I would like somebody to explain the DECODE function within pl/sql. I have some queries passed on to me by a former employee and I have to continue where he left off.
To me the use of decode seems to be very complicated and I would like some clarification.
For example, I have the following line:
having (sum(decode(z31_credit_debit,'C',z31_sum,0)) -
sum(decode(z31_credit_debit,'D',z31_sum,0)))
< -500
I know that that this is supposed to check for values less than -500. But I am confused with the syntax. 'C' and 'D' are the possible values in the z31_credit_debit field and the z31_sum is an integer.
I dont think i need to explain my db, just need help with getting my head round this decode function
I would like somebody to explain the DECODE function within pl/sql. I have some queries passed on to me by a former employee and I have to continue where he left off.
To me the use of decode seems to be very complicated and I would like some clarification.
For example, I have the following line:
having (sum(decode(z31_credit_debit,'C',z31_sum,0)) -
sum(decode(z31_credit_debit,'D',z31_sum,0)))
< -500
I know that that this is supposed to check for values less than -500. But I am confused with the syntax. 'C' and 'D' are the possible values in the z31_credit_debit field and the z31_sum is an integer.
I dont think i need to explain my db, just need help with getting my head round this decode function