gpt4 book ai didi

sql - 如何在 PostgreSQL 中将数字转换为月份名称?

转载 作者:行者123 更新时间:2023-12-03 02:50:40 25 4
gpt4 key购买 nike

我正在尝试将字符串数字转换为月份名称,但我搜索了很多资源,但它对我没有帮助。

这是我的查询

SELECT CAST(extract('month'
FROM to_date(proforma_invoice_date, 'DD/MM/YYYY')) AS VARCHAR) AS proforma_invoice_date
FROM proforma_invoice

这是我的输出...

enter image description here

最佳答案

使用to_char():

to_char(to_date(proforma_invoice_date, 'DD/MM/YYYY')), 'Month')

关于sql - 如何在 PostgreSQL 中将数字转换为月份名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59267191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com