我如何能在下面的查詢翻譯成的DetachedCriteria: select * from (
select a.* ,row_number() over (partition by hotel_id order by EXECUTION_START_DATE desc) rnk
from HOLIDAY_PACKAGES a
)
where rnk = 1
我想這樣一個腳本轉換成標準: SELECT ...
FROM A
WHERE
A.some_date > (select bdate from B where ...)
OR (select bdate from B where ...) IS NULL
所以,一個A應該如果任A.Some_date> B.bdate作退回或者如果B.bdate爲NULL。 我期待那裏有