开发者

DB2: converting date values to varchar

开发者 https://www.devze.com 2023-04-06 11:56 出处:网络
I am new to databases, in fact this is first time. I want to select the date column from a table and the date to be printed as an output in 开发者_StackOverflow中文版some given format, like is there

I am new to databases, in fact this is first time.

I want to select the date column from a table and the date to be printed as an output in 开发者_StackOverflow中文版some given format, like is there a way i can specify the format of output of this conversion.

eg:

date: 01/01/2011

output :

Jan 1 2011

or

1st January 2011

Is there a function or way to do so? My guess is there must be?

Thanks


Try this:

VARCHAR_FORMAT(DATE, 'MON DD YYYY')

VARCHAR_FORMAT

0

精彩评论

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

关注公众号