这是从两个表中获取数据的查询
博客
和
askquestions
HQL查询用于以下SQL查询:
select title , date from (select blog_title as title ,created_date as date from blog union select ask_question as title , created_on as date from askquestions ) as aa order by date desc
提前感谢您的任何答案或建议!
答案 0 :(得分:0)
hibernate不支持联合,请参阅How to do a Union SQL statement in HQL?
有关替代方案,请参阅Hibernate Union alternatives