select dx.docid,
case dx.tel_mobile
when '1%' then
dx.tel_mobile
else
dx.tel
end
as tel,
dx.xxbh,
doc.docinfo
from SWDX_XX_SENDLIST dx, SWDX_FLOW_DOC doc
where dx.docid = doc.docid
and dx.sendflag = 0
and (dx.tel like '1%' or dx.tel_mobile like '1%')
case dx.tel_mobile
when '1%' then
dx.tel_mobile
else
dx.tel
end
这段话的意思就是如果tel_mobile是以1开头的手机,那么我们就得到tel_mobile,否则我们就得到 dx.tel