Improving SQL efficiency using CASE - Doug …