delete adjacent duplicates from用法(以某个关键字删除相邻重复行的数据)

一.知识点;
DELETE ADJACENT DUPLICATES FROM.

二.例子;
SORT gt_resb BY matnr.
DELETE ADJACENT DUPLICATES FROM gt_resb COMPARING matnr.  

用之前
在这里插入图片描述
用之后
在这里插入图片描述

三. 总结;

1.保留的是第一行,后面重复的都删除。
2.不要用select distinct,会再数据系统中排序,因此会绕过SAP缓存,这样速度会慢,这个语法不建议使用,不能在大表中,可以在小表中。
3.能在内表中操作,一定要在内表中操作,不能在数据表中操作
4.一定要排序. 这样才能完全去除重复的行;
在这里插入图片描述5. From sap official explation.

With these additions, the statement DELETE deletes all lines in certain groups of lines, except for the first line of the group. These are groups of lines that follow one another and have the same content in certain components. If the addition COMPARING is not specified, the groups are determined by the content of the key fields.

Lines are considered to be doubled if the content of neighboring lines is the same in the components examined. In the case of several double lines following one another, all the lines - except for the first - are deleted.

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值