-1
我怎樣才能在JPQL如何實現DATE_FORMAT在JPQL
select *
from `attendence`
where DATE_FORMAT(date, "%m-%Y") = "10-2012"
我已經使用功能做詳細的功能,但無法實現相同的功能之上。
我怎樣才能在JPQL如何實現DATE_FORMAT在JPQL
select *
from `attendence`
where DATE_FORMAT(date, "%m-%Y") = "10-2012"
我已經使用功能做詳細的功能,但無法實現相同的功能之上。
如果你做了這樣的選擇,你會在日期中銷燬潛在的索引。
可以或許做這樣的事情:
select * from attendence whre date>=:start and date<:end
開始=新的SimpleDateFormat( 「YYYY-MM-DD」)解析( 「2012-10-01」); end = new SimpleDateFormat(「yyyy-MM-dd」)。parse(「2012-11-01」);
您的JPQL在哪裏不起作用? – ujulu