mysql修复VIEWRESIDENTHIST 数据

发布时间:2024年01月10日


select count(*) from VisitRemind


select VISIT_MODE,count(*) from HEALTH_HYPER_PATI_SERVICE_NEW GROUP BY VISIT_MODE
select COLLECT_MODE,count(*) from HEALTH_HYPER_PATI_SERVICE_NEW GROUP BY COLLECT_MODE

select count(*) from VIEWRESIDENTHIST; -- 624984 287368

select count(*) from VIEWRESIDENTHIST where examine is null;

select * from VIEWRESIDENTHIST where examine is not null;


select count(*) from VIEWRESIDENTHIST_copy1
select count(*) from VIEWRESIDENTHIST
select VISIT_MODE,count(*) from VIEWRESIDENTHIST group by VISIT_MODE

select * from VIEWRESIDENTHIST where VISIT_MODE=0

select * from VIEWRESIDENTHIST where VISIT_MODE is null

select VISIT_MODE,count(*) from VIEWRESIDENTHIST group by mbType

select mbType,VISIT_MODE from VIEWRESIDENTHIST where VISIT_MODE=0 GROUP BY mbType

select mbType,VISIT_MODE from VIEWRESIDENTHIST where VISIT_MODE is null GROUP BY mbType?

select count(*) from HEALTH_DIABETES_FOLLOW -- 65004
select count(*) from HEALTH_MENTAL_DISEASE -- 5138
select count(*) from HEALTH_TUBERCULOSIS_VISIT -- 29
select count(*) from HEALTH_TUBERCULOSIS_VISIT_MORE -- 179
select count(*) from HEALTH_HYPER_PATI_SERVICE_NEW -- 216998


select * from HEALTH_DIABETES_FOLLOW where ?VISIT_MODE=0 or VISIT_MODE is null; -- 923
select * from HEALTH_MENTAL_DISEASE where ?VISIT_MODE=0 or VISIT_MODE is null; -- 892
select * from HEALTH_TUBERCULOSIS_VISIT where ?VISIT_MODE=0 or VISIT_MODE is null;
select * from HEALTH_TUBERCULOSIS_VISIT_MORE where ?VISIT_MODE=0 or VISIT_MODE is null; -- 2

-- 修复糖尿病数据
update HEALTH_DIABETES_FOLLOW a set a.VISIT_MODE=2 where VISIT_MODE=0 or VISIT_MODE is null;
-- 修复精神病数据
update HEALTH_MENTAL_DISEASE a set a.VISIT_MODE=2 where VISIT_MODE=0 or VISIT_MODE is null;
-- 修复肺结核1数据
update HEALTH_TUBERCULOSIS_VISIT a set a.VISIT_MODE=2 where VISIT_MODE=0 or VISIT_MODE is null;
-- 修复肺结核2数据
update HEALTH_TUBERCULOSIS_VISIT_MORE a set a.VISIT_MODE=2 where VISIT_MODE=0 or VISIT_MODE is null;
-- 最后一步
update VIEWRESIDENTHIST a,(select * from VIEWRESIDENTHIST_copy1 where examine is not null) b set a.examine=b.examine,a.auditFeedback=b.auditFeedback where a.mbType=b.mbType and a.sourceId=b.sourceId

文章来源:https://blog.csdn.net/Jwg199908/article/details/135510907
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。