Referring to a previous question, i was wondering if its always possible to replace DECODE by CASE and which one is better for performance?
An old thread, I know but another interesting comparison between CASE
and DECODE
... pick your poison.
SELECT CASE 1 WHEN '1' THEN 'A' ELSE 2 END result
FROM DUAL
/*
ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*/
;
SELECT DECODE(1, '1', 'A', 2) result
FROM DUAL
/*
A
*/
;