是不是也是"date",但我试了一下,不知为什么不行?以及输入时间的格式是怎样的?(注意:不是日期,是时间,例如:具体时间:(17:19:37),怎样实现输入?)

解决方案 »

  1.   

    日期和时间是放在一起的
    select to_date('17:19:37','hh24:mi:ss') from dual;
      

  2.   

    仅取时间的话
    select to_char(sysdate,'hh24miss') from dual;
      

  3.   

    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
      

  4.   

    如2003-4-1
    insert into tablename values(to_date('2003-4-1','yyyy-mm-dd'),...,);
      

  5.   

    以上的所有方法会把年月日时分秒全取出来
    如果只取时分秒可以用下面的办法
    select substr(to_date('12:12:12','hh24:mi:ss'),-8) from dual
    如果不用substr还是会把日期取出来select to_char(sysdate,'hh24miss') from dual;
    可以取出时间值,但只能取当前系统时间
    如果自定义时间只能用上面的办法做了
      

  6.   

    insert into demo values(to_date(to_char(sysdate,'yyy-mm-dd HH24:MI:SS'),'yyy-mm_dd HH24:MI:SS));