在HQL中加入复合表

时间:2018-06-08 14:51:18

标签: sql hql

是否可以在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

0 个答案:

没有答案