Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将其转换为 varchar 结果..
select date_trunc('week', '2013-02-01'::date);
我将把它用于具有 varchar 数据类型的“Where”子句
谢谢
to_char为了能够控制 varchar 结果的格式,我将使用:
to_char
select to_char(date_trunc('week', '2013-02-01'::date), 'yyyy-mm-dd');
你不能把它转换成TEXT吗?
select date_trunc('week', '2013-02-01'::date)::text;