SQL SERVER比较两个表

SELECT *
FROM v_u8sync_inv_demand_storage
    FULL OUTER JOIN u8sync_inv_demand_storage
        ON v_u8sync_inv_demand_storage.存货档案_存货编码 = u8sync_inv_demand_storage.存货档案_存货编码
WHERE (
          v_u8sync_inv_demand_storage.存货档案_存货编码 IS NULL
          AND u8sync_inv_demand_storage.存货档案_存货编码 IS NOT NULL
      )
      OR
      (
          v_u8sync_inv_demand_storage.存货档案_存货编码 IS NOT NULL
          AND u8sync_inv_demand_storage.存货档案_存货编码 IS NULL
      )
      OR
      (
          v_u8sync_inv_demand_storage.存货档案_存货编码 IS NOT NULL
          AND u8sync_inv_demand_storage.存货档案_存货编码 IS NOT NULL
          AND
          (
              v_u8sync_inv_demand_storage.存货档案_存货编码 <> u8sync_inv_demand_storage.存货档案_存货编码
              OR v_u8sync_inv_demand_storage.存货档案_存货名称 <> u8sync_inv_demand_storage.存货档案_存货名称
              OR v_u8sync_inv_demand_storage.存货档案_规格型号 <> u8sync_inv_demand_storage.存货档案_规格型号
              OR v_u8sync_inv_demand_storage.存货名称 <> u8sync_inv_demand_storage.存货名称
              OR v_u8sync_inv_demand_storage.规格型号 <> u8sync_inv_demand_storage.规格型号
              OR v_u8sync_inv_demand_storage.库存存货编码 <> u8sync_inv_demand_storage.库存存货编码
              OR v_u8sync_inv_demand_storage.库存存货档案名称 <> u8sync_inv_demand_storage.库存存货档案名称
              OR v_u8sync_inv_demand_storage.库存存货规格型号 <> u8sync_inv_demand_storage.库存存货规格型号
              OR v_u8sync_inv_demand_storage.库存数量 <> u8sync_inv_demand_storage.库存数量
              OR v_u8sync_inv_demand_storage.生产订单存货编码 <> u8sync_inv_demand_storage.生产订单存货编码
              OR v_u8sync_inv_demand_storage.生产订单存货规格型号 <> u8sync_inv_demand_storage.生产订单存货规格型号
              OR v_u8sync_inv_demand_storage.生产订单存货名称 <> u8sync_inv_demand_storage.生产订单存货名称
              OR v_u8sync_inv_demand_storage.生产订单累计入库数量 <> u8sync_inv_demand_storage.生产订单累计入库数量
              OR v_u8sync_inv_demand_storage.生产订单数量 <> u8sync_inv_demand_storage.生产订单数量
              OR v_u8sync_inv_demand_storage.生产订单未入库数量 <> u8sync_inv_demand_storage.生产订单未入库数量
              OR v_u8sync_inv_demand_storage.生产订单未入库数量不能满足生产订单数量 <> u8sync_inv_demand_storage.生产订单未入库数量不能满足生产订单数量
              OR v_u8sync_inv_demand_storage.索物函累计发货数量 <> u8sync_inv_demand_storage.索物函累计发货数量
              OR v_u8sync_inv_demand_storage.索物函累计未发货数量 <> u8sync_inv_demand_storage.索物函累计未发货数量
              OR v_u8sync_inv_demand_storage.索物函累计需求数量 <> u8sync_inv_demand_storage.索物函累计需求数量
              OR v_u8sync_inv_demand_storage.物料编码 <> u8sync_inv_demand_storage.物料编码
          )
      );
 

相关推荐

  1. SQL SERVER比较

    2024-05-01 14:30:03       34 阅读
  2. C语言 比较字符串

    2024-05-01 14:30:03       23 阅读
  3. 连接

    2024-05-01 14:30:03       64 阅读
  4. 归并为有序

    2024-05-01 14:30:03       28 阅读
  5. Python使用余弦相似度比较图片

    2024-05-01 14:30:03       63 阅读
  6. 比较文本文件是否相等(C语言)

    2024-05-01 14:30:03       53 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-01 14:30:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-01 14:30:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-01 14:30:03       87 阅读
  4. Python语言-面向对象

    2024-05-01 14:30:03       96 阅读

热门阅读

  1. 揭秘FastStone Capture

    2024-05-01 14:30:03       26 阅读
  2. 在windows中安装flask虚拟环境步骤

    2024-05-01 14:30:03       34 阅读
  3. Linux从入门到精通

    2024-05-01 14:30:03       26 阅读
  4. 2024年华东杯数学建模思路+论文+代码

    2024-05-01 14:30:03       29 阅读