标签:style blog color sp 数据 on div 2014 log
1.update数据
UPDATE VOL_BASEINFO b SET (b.vlbi_zzmmm, b.vlbi_mzm) = (select t.zz,t.mz from MY_ZHB_2014 t where t.xh= b.vlbi_xh) where b.vlbi_xh like ‘14%‘;
2.根据身份证号判断男女
decode(mod(to_number(substr(‘身份证号‘, 17, 1)), 2), 0, ‘2‘, ‘1‘)
a.先截取身份证的倒数第二位数字
b.被2整除
c.如果余数是0,则为2-女
d.如果余数是不为0,则为1-男
select decode(mod(to_number(substr(‘身份证号‘, 17, 1)), 2), 0, ‘2‘, ‘1‘) from dual
oracle下常用查询更新命令(身份证号判断男女,更新语句多表查询)
标签:style blog color sp 数据 on div 2014 log
原文地址:http://www.cnblogs.com/hellowoody/p/4113292.html