17,377
社区成员
发帖
与我相关
我的任务
分享
--这个好用,呵呵呵
select name,''||birth from tb;
--更新的时候改下会话的时间格式 SQL> alter session set nls_date_format='yyyymmdd',把它隐性转为字符就可以了,下面是个例子
SQL> create table test6(id number,dt date,ch varchar2(8))
2 /
表已创建。
SQL> edi
已写入 file afiedt.buf
1 insert into test6(id,dt) select 1,to_date('2010-09-15','yyyy-mm-dd') from dual
2 union all
3* select 2,to_date('2010/08/15','yyyy/mm/dd') from dual
SQL> /
已创建2行。
SQL> commit
2 /
提交完成。
SQL> alter session set nls_date_format='yyyymmdd'
2 /
会话已更改。
SQL> update test6 set ch=''||dt
2 /
已更新2行。
SQL> commit
2 /
提交完成。
SQL> select * from test6
2 /
ID DT CH
---------- -------- --------
1 20100915 20100915
2 20100815 20100815