欧美麻豆久久久久久中文_成年免费观看_男人天堂亚洲成人_中国一级片_动漫黄网站免费永久在线观看_国产精品自产av一区二区三区

中培偉業IT資訊頻道
您現在的位置:首頁 > IT資訊 > 數據庫 > Oracle數據庫如何識別個人信息的?

Oracle數據庫如何識別個人信息的?

2020-07-29 15:47:51 | 來源:中培企業IT培訓網

Oracle數據庫也是眾多數據庫相對比較常見的數據庫。很多個人或者企業都在使用Oracle數據庫進行處理一些數據。就好比Oracle數據庫如何識別個人信息的等的問題。本文主要介紹Oracle根據身份證號獲取人員城市,性別和年齡的信息。同時用示例代碼向您詳細展示,該示例代碼對每個人的學習或工作都有一定的參考價值,需要的朋友可以參考它。

  1、通過身份證號查詢所在省市

SELECT

count(*) as total,

case substr(t.CERTNO,0,2)

when '11' then '北京市'

when '12' then '天津市'

when '13' then '河北省'

when '14' then '山西省'

when '15' then '內蒙古自治區'

when '21' then '遼寧省'

when '22' then '吉林省'

when '23' then '黑龍江省'

when '31' then '上海市'

when '32' then '江蘇省'

when '33' then '浙江省'

when '34' then '安徽省'

when '35' then '福建省'

when '36' then '江西省'

when '37' then '山東省'

when '41' then '河南省'

when '42' then '湖北省'

when '43' then '湖南省'

when '44' then '廣東省'

when '45' then '廣西壯族自治區'

when '46' then '海南省'

when '50' then '重慶市'

when '51' then '四川省'

when '52' then '貴州省'

when '53' then '云南省'

when '54' then '西藏自治區'

when '61' then '陜西省'

when '62' then '甘肅省'

when '63' then '青海省'

when '64' then '寧夏回族自治區'

when '65' then '新疆維吾爾自治區'

when '71' then '臺灣省'

when '81' then '香港特別行政區'

when '82' then '澳門特別行政區'

else '未知'

end AS province

FROM uip_bjt_userinfo t

group by case substr(t.CERTNO,0,2)

when '11' then '北京市'

when '12' then '天津市'

when '13' then '河北省'

when '14' then '山西省'

when '15' then '內蒙古自治區'

when '21' then '遼寧省'

when '22' then '吉林省'

when '23' then '黑龍江省'

when '31' then '上海市'

when '32' then '江蘇省'

when '33' then '浙江省'

when '34' then '安徽省'

when '35' then '福建省'

when '36' then '江西省'

when '37' then '山東省'

when '41' then '河南省'

when '42' then '湖北省'

when '43' then '湖南省'

when '44' then '廣東省'

when '45' then '廣西壯族自治區'

when '46' then '海南省'

when '50' then '重慶市'

when '51' then '四川省'

when '52' then '貴州省'

when '53' then '云南省'

when '54' then '西藏自治區'

when '61' then '陜西省'

when '62' then '甘肅省'

when '63' then '青海省'

when '64' then '寧夏回族自治區'

when '65' then '新疆維吾爾自治區'

when '71' then '臺灣省'

when '81' then '香港特別行政區'

when '82' then '澳門特別行政區'

else '未知'end order by province desc

  2、通過身份證號得到性別(第17位為奇數為男,偶數為女)

select

decode(mod(to_number(substr(t.useridcardnum, 17, 1)), 2),0,'女','男') as sex

from uip_ca_userinfo t

  3、通過身份證號得到年齡

select to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) as age from uip_ca_userinfo t

  4、通過身份證號統計所在年齡段的人數

select count(t.id),

case

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 1 and 20 then

'1-20歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 21 and 30 then

'21-30歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 31 and 40 then

'31-40歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 41 and 50 then

'41-50歲'

else

'50歲以上'

end as 年齡段

from uip_ca_userinfo t

group by case

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 1 and 20 then

'1-20歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 21 and 30 then

'21-30歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 31 and 40 then

'31-40歲'

when to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 41 and 50 then

'41-50歲'

else

'50歲以上'

end

order by 年齡段 asc

  5、通過身份證號統計男女數量

select count(t.id),

decode(mod(to_number(substr(t.useridcardnum, 17, 1)), 2),0,'女','男') as sex

from uip_ca_userinfo t

where to_char(sysdate, 'yyyy') - substr(t.useridcardnum, 7, 4) between 1 and 26

group by decode(mod(to_number(substr(t.useridcardnum, 17, 1)), 2),0,'女','男')

Oracle數據庫如何識別個人信息的相信大家已經知曉了吧,想了解更多關于Oracle數據庫的信息,請繼續關注中培偉業。

標簽: Oracle 數據庫
主站蜘蛛池模板: 精品人妻一区二区三区四区 | 久久人妻少妇嫩草av蜜桃 | 日本女优免费一区 | 寂寞少妇被猛烈进入在线兔费观看 | 亚洲夜夜性无码 | 亚洲精品无码专区久久 | 欧美日韩免费一久久亚洲色WWW成人小说 | 亚洲欧洲日本综合aⅴ在线 亚洲五月综合缴情在线观看 | 日韩东京热无码AV一区 | 亚洲加勒比无码一区二区 | 醉酒后少妇被疯狂内射视频 | 麻豆国产成人AV在线播放 | 高柳の肉嫁动漫在线播放 | 国产成人精品亚洲午夜麻豆 | 肉蒲团从国内封禁到日本成经典 | 国产八十老太另类 | 国产A线视频播放 | 免费女人18毛片a毛片视频 | 日韩亚洲欧美在线观看 | 免费精品在线视频 | 欧美日韩精品视频一区二区三区 | 亚洲人成色777777老人头 | 老太婆性杂交视频 | 裸体美女无遮挡免费网站 | 人妻丰满熟妇V无码区A片 | 久久激情日本亚洲欧洲国产中文 | 欧美人与动牲猛交a欧美精品 | 公和我在野外做好爽爱爱小说雨婷 | 老师开裆丝袜喷水视频 | 中文字幕在线无码一区二区三区 | 国产亚洲精品久久久久久无几年桃 | 日本黄区免费视频观看 | 抖音奶片无罩子52秒回放 | 真人女人一级毛片免费播放 | 精品欧美А∨无码黑人大战少妇 | 亚洲人片在线观看天堂无码 | 秒播无码国产在线观看 | 国产乱子伦精品免费女 | 色欲久久九色一区二区三区 | 黄色在线免费观看视频 | 在线观看黄色免费网站 |