首页 > 解决方案 > 将SQL查询查找比两个子查询转换为HQL

问题描述

我正在尝试将以下查询转换为 HQL:

select x / total*100 from
(select count( * ) as x from events e, publish_events p where e.event_id = p.event_id and e.amount <> 0 and e.creation_date > sysdate-2 and p.publish_status = 'xxxxxx' and p.publish_requester = 'xxxxx'),
(select count(*) total from events e1 where e1.creation_date > sysdate-2 and e1.event_code in (11,111,1111));

我怎么能解决这个问题?

标签: sqlhibernatehql

解决方案


推荐阅读