select id from(select a.id,a.phone aphone,a.type,b.phone bphone from a left join b on substr(a.phone,9,8) = b.phone)where bphone is null and id > 0;---以上,希望对你有所帮助。