How to use date_format when using JPQL/JPA
问题 I am doing Java EE with MySQL as database and implementing JPA on my codes. I have no problem retrieving the data from MySQL Workbench but when I change my syntax to JPQL's it does not work. For e.g. in MySQL - it works SELECT date_format(s.date,'%Y, %m, %d') from Transactions s; in JPQL - it does not SELECT date_format(s.date,'%Y, %m, %d') from TransactionEntity s; How do i modify to suit the JPA query? Note: in JPQL the following works SELECT s.date from TransactionEntity s; 回答1: SQL