查sb n_certinfo表,字段customer_name=用户姓名,cert _num=用户身份证号,cert_type=证件类型,substr(cert_num, 7,8)=从第七位开始,截取八个字段。
select
b.customer_name,
b.cert_num,
substr(cert_num, 7,8) a
from sb_n_certinfo b
where
lengthb(cert_num) = 18
and cert_type =10
order by a desc