Databases: I want to change to Dynamic SQL Query instead of CASE statement

Published --