标签:
--统计表 SELECT * FROM T_SG_SJDJTJ; --数据表 SELECT * FROM v_dataservice_ext T WHERE T.DATA_TYPE=‘0‘; --从描述信息核对(统计表有,业务表没有) SELECT * FROM T_SG_SJDJTJ T WHERE T.MSXX NOT IN( SELECT S.DATA_NAME FROM v_dataservice_ext S WHERE S.DATA_TYPE=‘0‘ ); --从表名核对 SELECT t.*,t.rowid FROM T_SG_SJDJTJ T WHERE T.YWB NOT IN( SELECT S.TABLE_NAME FROM v_dataservice_ext S WHERE S.DATA_TYPE=‘0‘ ); --综合核对 SELECT M.TABLE_NAME,N.YWB,M.UNIT_NAME,N.YWDW FROM v_dataservice_ext M, ( SELECT T.MSXX,T.YWB,T.YWDW FROM T_SG_SJDJTJ T WHERE T.YWB NOT IN( SELECT S.TABLE_NAME FROM v_dataservice_ext S, T_SG_SJDJTJ T WHERE S.DATA_TYPE=‘0‘ AND S.DATA_NAME=T.MSXX AND S.UNIT_NAME=T.YWDW --AND S.TABLE_NAME<>T.YWB ))N WHERE M.DATA_NAME=N.MSXX AND M.DATA_TYPE=‘0‘;
--本周更新数据 SELECT * FROM T_SG_SJDJTJ S WHERE S.MSXX NOT IN( SELECT T.DATA_NAME FROM T_SJTJ T );
标签:
原文地址:http://www.cnblogs.com/wuyechun/p/5445516.html