Oracle中日期时间字段的处理方案
在PL/SQL中对表中的日期字段赋值的方法:
(1)输入指定日期:
insert into StudentInfo (StuID,StuName,Birthday) values ('004','Jacky',to_Date('2009-3-8','yyyy-mm-dd'));insert into StudentInfo (StuID,StuName,Birthday) values ('004','Jacky',sysdate);select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; --注意:mm代表月份, mi代表分钟--或者:select to_char(sysdate,'yyyy-mm-dd hh:mi:ss') from dual;
select id,extract(year from hiredate)||'年'||extract(month from hiredate)||'月'||extract(day from hiredate)||'日' from employee;