【发布时间】:2014-06-17 10:24:26
【问题描述】:
我想将以下查询转换为 HQL
select X.* from (select tbl.*,ROW_NUMBER() over (partition by Col1 order by Col1) as RANK from table1 tbl where tbl.col2='22'
and (
tbl.col3 in (
'ABC'
)
)
) X
WHERE X.rank = 1;
需要帮助。 这是在 Oracle 上将 MySQL group by 转换为等效 group by 的上下文中。
编辑: 我原来的 MySQL 查询是
select * from table1 tbl
where tbl.col2='22'
and tbl.col3 in ('ABC','XYZ')
group by col1;
我想先将其转换为 Oracle 等效查询,然后再转换为 HQL。
【问题讨论】: