I have an SQL command that has multiple selects, functions and joins using H2 database. I need to convert it to JPQL.
SELECT TotalHours, ROUND(PRICE*TotalHours, 2) AS TotalPayment, PLATE_NUM, CUSTOMER_ID FROM (
SELECT (DATEDIFF(s, TIMESTAMP'2020-07-29 16:00:00', TIMESTAMP'2020-08-10 07:00:00') / 3600.0) AS TotalHours, c.PRICE, b.PLATE_NUM, b.CUSTOMER_ID
from BOOKING b inner join CAR c on b.PLATE_NUM = c.PLATE_NUM
) AS x;
Could you help, please?