query=session.createQuery("from Seedlingforecast aps where  fid in(select min(fid) from Seedlingforecast group by (aps.pest.pno and aps.countryseedling.csno))");

解决方案 »

  1.   

    补充一下,其实就查了Seedlingforecast一张表,想查出pno 和csno的组合种类,重复的不要。
      

  2.   

     FROM Event as t where t.id in (SELECT min(t1.id) from Event as t1 group by t1.date,t1.title)
    类似的没有问题啊
    from Seedlingforecast aps where aps.fid in(select min(aps1.fid) from Seedlingforecast aps1 group by aps1.pest.pno,aps1.countryseedling.csno)