从时间戳中提取年和月(6)

Mar*_*óňa 3 oracle timestamp extract iso8601

我有数据库,其中i在这个格式插入时间戳(6): 18-AUG-14 02.49.27.000000000 PM

我想把它提取成这个:2014-08

它被称为 ISO 8601

Sat*_*hat 8

您需要使用to_char函数从时间戳中提取年月。

select to_char(timestamp, 'yyyy-mm') from your_table
Run Code Online (Sandbox Code Playgroud)