column name as variable in sql statement
SELECT CASE another_table.field
           WHEN 'A' THEN main_table.field_A
           WHEN 'B' THEN main_table.field_B
           WHEN 'C' THEN main_table.field_C
           WHEN 'D' THEN main_table.field_D
           ELSE NULL
       END, ...