Need help on coverting sql statement to NamedQueries
hi, all,
I have a problem on converting the following SQL statement returning last 10 records from an Oracle database.
The SQL statement is as followings:
select * from (select * from TABLE1 where ATT1 = 1 order by ATT2 desc) where rownum<11
However, how should I convert this statement into NamedQuery?
Thanks.
# 1
Will the following SQL return the same set of rows for you:
select * from TABLE1 where ATT1 = 1 order by ATT2 desc limit 1,10
If so, that query is a lot easier to convert.
I've never tried to convert a subquery into a NamedQuery. The problem is that you're not just converting to named query, but you're also changing from SQL to EJBQL, and they don't map directly even though the semantics are similar.
uvneta at 2007-7-29 16:48:49 >
