April 6, 2011

Use Decode and Substr

Using Decode and substr together:- 
Decode wil replace the IF-THEN-ELSE
e.g
SELECT full_name,
decode(Current_employee_flag, 'Y', 'EMP',
 'N', 'Not Emp')result
FROM per_all_people_f;
Substr will filter values to the length you specify
Eg
SELECT SUBSTR('Take the first four characters', 1, 4) FIRST_FOUR
FROM dual;

To use both:
SUM(DECODE(Substr(piv.uom, 1, 1), 'M', prrv.result_value, NULL))  amount,

Will result value will grouped for numeric values.

No comments:

Post a Comment

Thanks for your comments submitted.,will review and Post soon! by admin.

How I Identified 45 Configuration Gaps in an Oracle HCM Implementation — A Structured Approach

During a recent Oracle Fusion HCM implementation, I led a gap analysis that surfaced 45 configuration issues between the client's legacy...