select
workerid, workername,
case
when telno is not null and telno<>'' then a.telno
when a.telno2 is not null and a.telno2<>'' then a.telno2
when a.telno3 is not null and a.telno3<>'' then a.telno3
else '0' end as telno
from XXX
select
workerid, workername,
case
when telno is not null and telno<>'' then a.telno
when a.telno2 is not null and a.telno2<>'' then a.telno2
when a.telno3 is not null and a.telno3<>'' then a.telno3
else '0' end as telno
from XXX