PostgreSQL中的left()函数
我只需要显示时间的小时数。下面的脚本是我尝试做同样的事情 示例:PostgreSQL中的left()函数,postgresql,Postgresql,我只需要显示时间的小时数。下面的脚本是我尝试做同样的事情 示例: select left(visittime,2) from records; function left(time without time zone, integer) does not exist 此处visittime包含: 10:00:00; 所以我只需要显示其中的10。我已经尝试使用上面的脚本,但我得到了一个错误 错误: select left(visittime,2) from records; functio
select left(visittime,2) from records;
function left(time without time zone, integer) does not exist
此处visittime
包含:
10:00:00;
所以我只需要显示其中的10。我已经尝试使用上面的脚本,但我得到了一个错误
错误:
select left(visittime,2) from records;
function left(time without time zone, integer) does not exist
另一种选择是使用提取功能,如下所示:
select extract(hour from visittime) from records;
参考:
select left(visittime,2) from records;
function left(time without time zone, integer) does not exist
另一种选择是使用提取功能,如下所示:
select extract(hour from visittime) from records;
参考:
select left(visittime,2) from records;
function left(time without time zone, integer) does not exist
这是手册的情况,而不是如此:还有@ErwinBrandstetter,好吧!下次我会小心的。谢谢。这是一个手册的案例,而不是这么说的:还有@ErwinBrandstetter,好吧!下次我会小心的。谢谢,不客气!网站参考文档中有很多关于每个功能的信息和示例:-)不客气!网站参考上的文档中有很多信息+每个功能的示例:-)