hibernate删除重复数据
- 作者: 简简单单单
- 来源: 51数据库
- 2021-01-06
一:将第一次得到的数据插入临时表,即select into
二:将第一次得到的数据在程序中保存,用List或者Map,然后对List(Map)进行操作
sqlserver 是distinct hibernate也可以吧,不过也相当于jdbc.
select distinct a.field1 from tbl as a
加个distinct就可去重了,如下:
select b.a distinct from b where b.name='xx' and b.a.dept='pp'
二:将第一次得到的数据在程序中保存,用List或者Map,然后对List(Map)进行操作
sqlserver 是distinct hibernate也可以吧,不过也相当于jdbc.
select distinct a.field1 from tbl as a
加个distinct就可去重了,如下:
select b.a distinct from b where b.name='xx' and b.a.dept='pp'
推荐阅读
