Improving SQL efficiency using CASE - oracledoug.com