zoukankan      html  css  js  c++  java
  • 如何用oracle从身份证信息中提取出生日期?

    在项目开发中,有从身份证信息中提取出生日期的需求:

    1.对18位身份证,因为有多个表,所以用到它们的关联,示例如下:

    update pfapperosoninformation  p set p.pbirthday  = to_date(substr(p.perqualinumber,7,8),'YYYY-MM-DD')
    where p.pfpeopleid = (
           select max(s.personnel_id) from app_institutions_personnel s,
           pfapprovalinformation      a,
           sys_manage_unit   u
            where    
            s.personnel_id =p.pfpeopleid and s.org_id = a.pfappid and u.mid=a.mid and u.mcode not in('41417705X','414177068','41419989X','414477167')
      )
    and lengthb(p.perqualinumber)=18 and p.pbirthday is null  
     
    2.对15位身份证而言,它的一个例子如下:
    update pfapperosoninformation  p set p.pbirthday  = to_date(to_char('19'||substr(p.perqualinumber,7,6)),'YYYYMMDD')
    where p.pfpeopleid = (
           select max(s.personnel_id) from app_institutions_personnel s,
           pfapprovalinformation      a,
           sys_manage_unit   u
            where    
            s.personnel_id =p.pfpeopleid and s.org_id = a.pfappid and u.mid=a.mid and u.mcode not in('41417705X','414177068','41419989X','414477167')
      )
    and lengthb(p.perqualinumber)=15 and p.pbirthday is null  and substr(p.perqualinumber,9,2)>='01' and substr(p.perqualinumber,9,2)<='12'
  • 相关阅读:
    经典博客
    Django中间介
    Django知识总结
    django认证系统
    Django-model基础知识,ORM,表操作
    Django-MTV
    web框架
    html总结(常用插件,补充知识,经典例题)
    快速搭建vue脚手架
    Djngo Rest Framework
  • 原文地址:https://www.cnblogs.com/yangxiaowei/p/4424709.html
Copyright © 2011-2022 走看看