SQL(ORACLE用) - 取得EMAIL異常資料

其他判斷就再自己加,這邊是這次有想到的一些條件

--如果有英文@,._-符號以外的資料, 搜尋出來
select id
from (
select id, nvl(length(regexp_replace(contactor_email,'[a-zA-Z0-9@,._\-]','')),0) as emailLen
from t_member
)
where emailLen>0

--如果是null, 搜尋出來
select id
from t_member
where (contactor_email is null or length(TRIM(contactor_email))=0)

--如果不含@, 搜尋出來
select id 
from t_member
where contactor_email not like '%@%'
arrow
arrow
    文章標籤
    SQL ORACLE
    全站熱搜

    咪卡恰比 發表在 痞客邦 留言(0) 人氣()