利用Spring Repositories API,如何检索嵌入式DISTINCT
的{{1}}属性?以Object
对象为例;如何在以下查询中基于不同的部门名称选择所有不同的User
对象。
Department
答案 0 :(得分:2)
@Query(从用户u中选择不同的u,其中u.name =:name)
我认为这会返回你想要的@Kurai
答案 1 :(得分:2)
你需要类似的......尝试......祝你好运
select distinct <object_property> from <tablename>