AdminC
AnNong。
2019-06-20 11:34
采纳率: 46.7%
浏览 372
已采纳

hql中怎么使用top函数?一直报错 怎么优化啊 求大神帮忙

hql语句如下:

String hql = " from Contract c left join fetch c.family cf left join fetch c.house ch left join fetch ch.building chb left join fetch chb.project chbp " +
                "where (c.id in (SELECT id from Contract a where a.id in (SELECT TOP 1 id from Contract b where status=0 and a.familyId=b.familyId order BY startDate Desc)) or c.addType = 2)"
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

相关推荐