In this particular case, CASE might be better because it can use LIKE, which is better than SUBSTR which would negate the use of an index.
Though, specifying LIKE for each option might work against that, so its hard to tell.
CASE WHEN te.TEAM_ID LIKE 'MU%' THEN 'Manchester United' WHEN te.TEAM_ID LIKE 'RM%' THEN 'Real Madrid' END Team
In reply to Re^3: Mocked query returns wrong result
by chacham
in thread Mocked query returns wrong result
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |