同一个表中排除相同的同一个人(身份证有15位和18位)
2012-05-23 17:12
190 查看
select * from (select name,idcard,city ,DepartName,substring(idcard,7,9) id1 ,substring(idcard,1,6) part1 from [Constable] where len(idcard)=15) a1 inner join (select name,idcard,city,DepartName ,substring(idcard,9,9) id2,substring(idcard,1,6) part2 from [Constable] where len(idcard)=18) a2 on (a1.id1=a2.id2 and a1.part1 =a2.part2);
同一个表中在更新数据的时候获取了重复的人员,这条语句就是找出重复的人员,刚刚用到写出来的 分享一下
相关文章推荐
- 做一个牛XX的身份证号验证类(支持15位和18位)
- 做一个牛XX的身份证号验证类(支持15位和18位)
- 15位身份证号转18位word 宏代码
- 15位和18位身份证的正则表达式及其验证
- C#检验身份证号(包括18位和15位)并提取生日和性别
- VB.NET实现身份证15位升18位的算法
- 将15位身份证升级成18位的用户定义函数
- 身份证号码15位升18位
- JavaScript验证18位或者15位身份证号码是否合法
- oracle 中身份证号15位升18位
- 身份证号验证类,同时支持15位及18位身份证号
- sqlserver 将15位身份证升级成18位的用户定义函数
- 将15位的身份证号码升级到18位的关键是校验码
- 用VB将身份证从15位升级为18位的函数
- 身份证号转换15位与18位
- 写了个15位身份证号升级为18位的SQL语句
- 15位与18位身份证转换程序片段
- 15位到18位身份证的升级计算
- 15位身份证号转18位VB代码
- .NET 15位身份证升级到18位的算法