--select * from ti_vw_boss结果:
transactionid dn dn_type productid src_spid opt_type opt_time state
100000000000011213 158550570010PIBPXXT100118510 0 18-2月 -16 0
100000000000011244 158550570010PIBPXXT100118510 0 18-2月 -16 0现在要对表数据去重,留下一行,修改如下:
select * from ti_vw_boss where transactionid in (select min(TRANSACTIONID) from ti_vw_boss group by dn,dn_type,productid,src_spid);
结果:
transactionid dn dn_type productid src_spid opt_type opt_time state
100000000000011213 158550570010PIBPXXT100118510 0 18-2月 -16 0满足要求!
本文展示了如何使用SQL查询语句实现表数据去重并保留唯一记录的方法,通过实例解析了具体操作步骤。
1万+

被折叠的 条评论
为什么被折叠?



