SELECT *
FROM (SELECT van_num vn,
berth_from berth,
first_line_ashore_time first
FROM iportman.ipt_pilotagerecord pilot
WHERE ( Month(first_line_ashore_time) = 6
AND Year(first_line_ashore_time) = 2013 )
AND operation_movement = 'BERTHING') tab1
LEFT JOIN (SELECT van_num vn,
berth_from berth,
last_line_cast_off last
FROM iportman.ipt_pilotagerecord pilot
WHERE ( Month(last_line_cast_off) = 6
AND Year(last_line_cast_off) = 2013 )
AND operation_movement = 'UNBERTHING') tab2
ON tab1.vn = tab2.vn
我想在 JPQL 中执行上述查询。我们正在使用 JPA 2.0(Eclipselink 2.4.2)。请帮我将 SQL 查询转换为 JPQL。
提前致谢