我需要从数据库中选择我有完整日期的值.现在我必须在没有这一天的情况下获得这个日期,因为我必须按月分组和计算它们.
我是这样做的,但这会让我像1月的1月一样,我需要01 …
(extract(YEAR,Month from ak.date ) || '.' ||extract(Month from ak.date) ) as Datum
解决方法
使用
TO_CHAR
function:
TO_CHAR(ak.date,'YYYY.MM') as Datum