通过jpa2在postgresql中使用month()函数和year()函数 [英] month() function and year() function in postgresql through jpa2

查看:420
本文介绍了通过jpa2在postgresql中使用month()函数和year()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jpa2条件查询或jpql获取postgresql日期字段的月份和年份?

How to get the month and year of a postgresql date field using jpa2 criteria query or jpql?

有人这样做吗?

推荐答案

使用以下命令: FUNC('MyFunc',a,b,c)

示例: SELECT FUNC('to_char',current_date,'month')

这篇关于通过jpa2在postgresql中使用month()函数和year()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆