是否可以在HQL中编写此SQL语句? 如果没有,在这种情况下可能的方法是什么?
WITH t AS
(SELECT DISTINCT * FROM reserv res
INNER JOIN reservser rsr ON res.idreserv = rsr.idreserv
WHERE res.idorder = '12345')
SELECT * FROM t t1
LEFT JOIN t t2 ON t1.idreserv = t2.idreserv
AND t1.arrival = t2.departure