Ver originaldeclare @id_obra_social as char(1),@complejidad as char(1) set @id_obra_social='3'set @complejidad='2' select (case @complejidad when '1' then complejidad1 when '2' then complejidad2when '3' then complejidad3else complejidad4 end) as complejidad from obra_social where id_obra_social=@id_obra_social