处理驾校学员系统编号重复的问题
2014-06-06 17:34
78 查看
--1、检查学员编号重复的情况(非手工编号,手工编号对应TEMPXH,学员编号对应CXYBH)
--修改学员资料均是以学员编号为准的
--按理说学员编号是不允许重复的,重复是不能保存的
--只有一种可能就是当初手工调整过学员编号
select * from ec_xueyuan where cxybh in(select cxybh from ec_xueyuan where cxybh<>'' group by cxybh having(count(cxybh))>1) order by cxybh desc
--注意输出重复的学员编号,以便更新收费信息和考试信息
--2、列出重复中最大的序号的那个,注意第一步查询出来后先导出信息
select * from ec_xueyuan where xh in (select max(xh) from ec_xueyuan group by cxybh having count(cxybh)>1)
--3、更新学员编号,将序号最大的那个加个00
update ec_xueyuan set cxybh='00'+cxybh where xh in (select max(xh) from ec_xueyuan group by cxybh having count(cxybh)>1)
--update ec_xueyuan set cxybh='0155325' where xh=41513
--4、更新学员收费信息,查找收费信息只更新最后的那个收费,实在无法区分的话,此步省去
select * from ec_shoufei where cxybh='042149'
update ec_shoufei set cxybh='00'+cxybh where xh=38785
--5、更新学员考试成绩,注意区分更新那个,实在无法区分的话,此步省去
select * from ec_chengji where cxybh='042149'
update ec_chengji set cxybh='00'+cxybh where xh=387
--以下查询语句无实际意义=========
--列出重复的学员编号资料
select * from ec_xueyuan where cxybh like '%042149%' order by xh
--手工更新学员编号,将序号最大的那个加个00
update ec_xueyuan set cxybh='00'+cxybh where xh=5553
--检查手工编号重复的情况,手工编号重复系统是允许保存的,只要学员编号不重复系统允许
select * from ec_xueyuan where ctempbh in(select ctempbh from ec_xueyuan where ctempbh<>'' group by ctempbh having(count(ctempbh))>1)
--修改学员资料均是以学员编号为准的
--按理说学员编号是不允许重复的,重复是不能保存的
--只有一种可能就是当初手工调整过学员编号
select * from ec_xueyuan where cxybh in(select cxybh from ec_xueyuan where cxybh<>'' group by cxybh having(count(cxybh))>1) order by cxybh desc
--注意输出重复的学员编号,以便更新收费信息和考试信息
--2、列出重复中最大的序号的那个,注意第一步查询出来后先导出信息
select * from ec_xueyuan where xh in (select max(xh) from ec_xueyuan group by cxybh having count(cxybh)>1)
--3、更新学员编号,将序号最大的那个加个00
update ec_xueyuan set cxybh='00'+cxybh where xh in (select max(xh) from ec_xueyuan group by cxybh having count(cxybh)>1)
--update ec_xueyuan set cxybh='0155325' where xh=41513
--4、更新学员收费信息,查找收费信息只更新最后的那个收费,实在无法区分的话,此步省去
select * from ec_shoufei where cxybh='042149'
update ec_shoufei set cxybh='00'+cxybh where xh=38785
--5、更新学员考试成绩,注意区分更新那个,实在无法区分的话,此步省去
select * from ec_chengji where cxybh='042149'
update ec_chengji set cxybh='00'+cxybh where xh=387
--以下查询语句无实际意义=========
--列出重复的学员编号资料
select * from ec_xueyuan where cxybh like '%042149%' order by xh
--手工更新学员编号,将序号最大的那个加个00
update ec_xueyuan set cxybh='00'+cxybh where xh=5553
--检查手工编号重复的情况,手工编号重复系统是允许保存的,只要学员编号不重复系统允许
select * from ec_xueyuan where ctempbh in(select ctempbh from ec_xueyuan where ctempbh<>'' group by ctempbh having(count(ctempbh))>1)
相关文章推荐
- 重复提交、重复刷新、防止后退的问题以及处理方式
- 用PRINTF 和defineDEBUG条件编译来处理系统出错的问题
- C++头文件重复定义问题的处理(不会看看,会了防身!)
- 总结: 重复提交、重复刷新、防止后退的问题以及处理方式
- JSP 防止重复提交 防止重复刷新 防止后退问题以及处理方式
- OFSA系统中ORA-100问题的处理
- 虚拟主机环境WinWebMail邮件系统的常见问题处理
- Web2.0系统若干要处理的问题
- 重复提交、重复刷新、防止后退的问题以及处理方式
- 12.4 系统监控常见问题处理
- 重复提交、重复刷新、防止后退的问题以及处理方式
- 重复提交、重复刷新、防止后退的问题以及处理方式
- 系统自动登录及盘符无法双击打开问题处理 推荐
- 总结: 重复提交、重复刷新、防止后退的问题以及处理方式
- 转: 重复提交、重复刷新、防止后退的问题以及处理方式
- 重复提交、重复刷新、防止后退的问题以及处理方式
- userinit.exe丢失导致不能登录系统问题处理 推荐
- 重复提交、重复刷新、防止后退的问题以及处理方式
- Web2.0系统若干要处理的问题[转]
- 重复提交、重复刷新、防止后退的问题以及处理方式