select to_char(sysdate,'yyyymmdd') from dual;没问题
select to_char('2015-5-8 14:38:45','yyyymmdd') from dual;有错,应该怎么改下,
------解决思路----------------------
sysdate是date类型,'2015-5-8 14:38:45'是字符型
select to_char(to_date('2015-5-8 14:38:45', 'yyyy-mm-dd hh24:mi:ss'),'yyyymmdd') from dual;