开发者

EXTRACT for TIMESTAMP types in SQLite3

开发者 https://www.devze.com 2023-01-03 13:16 出处:网络
It seems extract function is not supported by SQLite3 for timestamp types (ref). For example; select extract(year from l_shipdate) as l_year

It seems extract function is not supported by SQLite3 for timestamp types (ref). For example;

select
 extract(year from l_shipdate) as l_year
from
 ...

gives the following error; Error: near "from": syntax e开发者_JAVA百科rror

I wonder whether there is an alternative way to do this in SQLite3 (or through rewriting the SQL query).

Thanks in advance,


Try this

select strftime('%Y', l_shipdate) as l_year from...
0

精彩评论

暂无评论...
验证码 换一张
取 消