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
I want to execute the above query in JPQL. We are using JPA 2.0(Eclipselink 2.4.2 ). Please help me convert the SQL query to JPQL.
Thanks In advance
SELECTandWHEREclauses in JPQL. Therefore, it is unlikely to translate this SQL directly into JPQL.