How do i group by date only from date time field in JPQL

前端 未结 4 1831
无人共我
无人共我 2021-01-12 16:11

For mysql I wrote a query like

SELECT * FROM mytable GROUP BY DATE(dateTimeField)

But i can\'t use the DATE() function in JPQL

4条回答
  •  不知归路
    2021-01-12 16:54

    I'm afraid that's beyond the scope of what JPQL offers. You will have to resort to native queries.

    Here's the List of available functions in JPQL:

    Java EE Tutorial 6 > Persistence > JPQL > Functional Expressions

提交回复
热议问题