sql - SQL批量数据重复检查
问题描述
我有一个应用程序,可以从计费信息表的记录中找到重复项。每个进程包含大约 50K 记录。
表格和结果视图
In the above picture, highlighted are the result cols and here what I did is ,
Amount Paid Dup == Duplicate count of col 'Amount Paid',
AmountBilled Dup == Duplicate count of col 'AmountBilled',
Invoice Number WO Alpha Dup == Duplicate count of col value 'Invoice Number' without alpha,
Bill Number Dup == Duplicate count of col 'Bill Number',
Invoice and Bill Number Dup == Combined Duplicate count of col 'Invoice number and Bill Number'.
像上面一样,我需要检查 6 个 cols 的重复项,并且我使用了 merge into 和 with 语句,但是处理文档花费了太多时间。请建议处理类似重复检查的最佳方法。
解决方案
您是否尝试过INTERSECT sql 命令?
在不知道表结构的情况下,我不能给你一个代码示例
推荐阅读
- php - Php AWS S3通过服务器cron作业一次下载多个文件
- java - ORA-01858: 在预期为数字的地方发现了一个非数字字符 TRUNC(SYSDATE)+hour/24
- python - Pandas 中 DataTimeIndex 的变化年份
- java - 如何将类转换为泛型类型
- javascript - 如何使用 javascript 语言上传 zip 文件?
- azure-batch - 要启用 Azure 批处理上的公共网络访问
- python - How to get correct json print
- php - 在 Laravel 中一次更新多个表中出现的一些字段
- cors - Azure 函数 http 调用在 localhost 上时始终返回 Cross-Origin Request Blocked
- javascript - 添加多级下拉引导