in reply to Mocked query returns wrong result

Side comment: I never understood why people like DECODE() over CASE. I find CASE to be much clearer. Though, iirc, speed is the same for both.

Replies are listed 'Best First'.
Re^2: Mocked query returns wrong result
by Anonymous Monk on Oct 24, 2014 at 16:36 UTC

    Thanks for the information and suggestion.

      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