在我的 build.gradle 文件中,我升级了一个依赖项的版本(即:com.db:microservice-commons)。加载 gradle 更改后,我收到以下错误消息:
> Build file 'C:\Projects\Container\mschmidt\mount\booking-service\standalone\build.gradle' line: 50
> A problem occurred evaluating project ':standalone'.
> Could not resolve all files for configuration ':standalone:runtimeClasspath'.
> Could not resolve com.db:microservice-commons:2.4.1.
Required by:
project :standalone
project :standalone > project :service
> No matching variant of com.db:microservice-commons:2.4.1 was found. The consumer was configured to find a runtime of a library compatible with Java 10, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- …Run Code Online (Sandbox Code Playgroud) 在 plpgsql 函数中,我有一个简单的插入语句:
insert into table_Y (column1 ,
column2 ,
//more columns
int_date , -- example: '20190714'
//more columns
)
select value1 ,
value2 ,
//more values
date_value::integer ,
//more values
from table_X
Run Code Online (Sandbox Code Playgroud)
表 table_X 中的列“date_value”是日期类型。表 table_Y 中的列 int_date 是整数类型......所以使用以下表达式:
date_value::integer
Run Code Online (Sandbox Code Playgroud)
...我想将“date_value”列中的值转换为整数(例如,从 2019 年 7 月 14 日到“20190714”)。
但是,我收到以下错误消息:
ERROR: cannot cast type date to integer
Run Code Online (Sandbox Code Playgroud)
如何将日期转换为整数?
PS:这个问题的解决方案:在postgresql中将日期转换为整数在我的情况下没有帮助,因为我不想要天数。