用户登录
用户注册

分享至

hibernate去除重复数据

  • 作者: 爱42774197
  • 来源: 51数据库
  • 2020-10-17
一:将第一次得到的数据插入临时表,即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'
软件
前端设计
程序设计
Java相关