DISTINCT在JPA中使用哪一列,是否可以更改它?
这是使用DISTINCT的示例JPA查询:
select DISTINCT c from Customer c
Run Code Online (Sandbox Code Playgroud)
这没有多大意义 - 什么专栏是基于什么?它是否在实体上指定为注释,因为我找不到?
我想指定列来区分,例如:
select DISTINCT(c.name) c from Customer c
Run Code Online (Sandbox Code Playgroud)
我正在使用MySQL和Hibernate.