Average difference in JPQL

I have order accounts and good receiving accounts. Any account can have several account elements. In one item of the order invoice, there can be none and no more to receive invoice items.

I want to calculate the execution time, which is the average time difference between order and good receipt in a Java Persistance Query Language (Java Persistance Query Language) query over several days. I am using EclipseLink 2.4 as my continuity provider.

This is the request I tried to fulfill. Is there a way to get the average execution time using JPQL?

    jpql = "Select avg(b.createdAt - rb.createdAt) "
            + " from BillItem bi "
            + " join bi.bill b "
            + " joib bi.referanceBillItem rbi "
            + " join rbi.bill rb "
            + " where b.billType in :bts "
            + " and rb.billType in :rbts "
            + " and bi.item=:amp "
            + " and b.createdAt between :fd and :td "
            + " ";

      

+3


source to share





All Articles