se puede directamente en un query con un case, algo asi como lo siguiente:
Código SQL
[-]
Select
case a.id
when 1 then 'pedro'
when 2 then 'pablo'
when 3 then (select first 1 d.nombre from tablaNombres d where d.id = 3)
else 'No se quien mas'
end as nombre
from miTabla a