日期和时间是放在一起的 select to_date('17:19:37','hh24:mi:ss') from dual;
仅取时间的话 select to_char(sysdate,'hh24miss') from dual;
DATE Datatype The DATE datatype stores point-in-time values (dates and times) in a table. The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds
如2003-4-1 insert into tablename values(to_date('2003-4-1','yyyy-mm-dd'),...,);
以上的所有方法会把年月日时分秒全取出来 如果只取时分秒可以用下面的办法 select substr(to_date('12:12:12','hh24:mi:ss'),-8) from dual 如果不用substr还是会把日期取出来select to_char(sysdate,'hh24miss') from dual; 可以取出时间值,但只能取当前系统时间 如果自定义时间只能用上面的办法做了
insert into demo values(to_date(to_char(sysdate,'yyy-mm-dd HH24:MI:SS'),'yyy-mm_dd HH24:MI:SS));
select to_date('17:19:37','hh24:mi:ss') from dual;
select to_char(sysdate,'hh24miss') from dual;
The DATE datatype stores point-in-time values (dates and times) in a table. The DATE datatype stores the year (including the century), the month, the day, the hours,
the minutes, and the seconds
insert into tablename values(to_date('2003-4-1','yyyy-mm-dd'),...,);
如果只取时分秒可以用下面的办法
select substr(to_date('12:12:12','hh24:mi:ss'),-8) from dual
如果不用substr还是会把日期取出来select to_char(sysdate,'hh24miss') from dual;
可以取出时间值,但只能取当前系统时间
如果自定义时间只能用上面的办法做了