Código SQL [-] Select case when tipo=1 then apellido when tipo=2 then razonsocial en Campo from tu tabla
Select case when tipo=1 then apellido when tipo=2 then razonsocial en Campo from tu tabla