您的位置:程序门 -> db2 -> 数据库开发



怎么样格式化时间


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


怎么样格式化时间
发表于:2007-09-23 20:13:45 楼主
取得当前系统时间怎么样把它格式化为字符型的   只需要它的年和月(200709)
发表于:2007-09-23 20:48:361楼 得分:0
年×100+月   然后cast成char(n)
发表于:2007-09-24 13:30:142楼 得分:0
year(date) ¦ ¦month(date)
发表于:2007-09-24 13:42:503楼 得分:0
char(year   (current   timestamp)) ¦ ¦char(month(current   timestamp))
发表于:2007-09-27 10:02:194楼 得分:0
select   left(replace(cast(current   date   as   char(10)),'-',''),6)   from   dual;


快速检索

最新资讯
热门点击