oracle distinct多字段去重
2016-02-19 10:56
597 查看
--select * from ti_vw_boss结果:
现在要对表数据去重,留下一行,修改如下:
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 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
满足要求!
相关文章推荐
- 什么是ORACLE ASM
- ORACLE函数大全(转载)
- oracle rac环境搭建
- Java环境下实现oracle数据库的备份与还原
- Linux下安装Oracle的过程和涉及的知识点-系列4
- 【Oracle】RAC添加新节点
- Oracle创建临时表空间/表空间/创建用户/授权
- Oracle堆表内部存储机制
- Oracle 使用MERGE INTO 语句更新数据的脚本
- Oracle使用profiler来测试PL/SQL的性能
- Uninstall Oracle Database 12c
- Oracle 建立索引及SQL优化
- oracle安装
- Oracle 11g 通过间隔分区实现按月创建表分区
- oracle通用分页语句rownum
- 说说自己学习Oracle的方法
- oracle之条件查询、模糊查询、运算符
- oracle 笔记
- Oracle12c中数据删除(delete)新特性之数据库内归档功能
- Oracle 11g导出的dmp文件导入到10g