假设有这么一个表,表名为a,只有两个字段,
id,number(3)
tt,date
现在我要使用sql语句插入记录,语句如下:
insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34','yyyy-mm-dd hh;mi:ss'));执行时语句报错,hour只能在0~12之间,然后将sql语句修改为
insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34 PM','yyyy-mm-dd hh;mi:ss AM'));
执行时仍然报错,请教这是什么问题,该如何解决,多谢

解决方案 »

  1.   

    insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34','yyyy-mm-dd hh24;mi:ss'));
      

  2.   

    insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34','yyyy-mm-dd hh24;mi:ss'));
    lalakid(梦想总是那么美好……)的解答不对
      

  3.   

    为什么不对啊!'yyyy-mm-dd hh24;mi:ss'));
    就是24小时的啊!
      

  4.   

    你的语句:
    insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34','yyyy-mm-dd hh;mi:ss'))。怎么在'yyyy-mm-dd hh;mi:ss'中的hh后面是分号?应该也是冒号,yyyy-mm-dd hh:mi:ss
      

  5.   

    Hero__008(北斗魁星) 的是对的.>select to_date('2007-05-20 13:20:34','yyyy-mm-dd hh24;mi:ss')
      2  from dual;TO_DATE('2007-05-20
    -------------------
    2007-05-20 13:20:34
      

  6.   

    假设有这么一个表,表名为a,只有两个字段,
    id,number(3)
    tt,date
    现在我要使用sql语句插入记录,语句如下:
    insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34','yyyy-mm-dd hh;mi:ss'));执行时语句报错,hour只能在0~12之间,然后将sql语句修改为
    insert into a(id,tt) values(1,to_date('2007-05-20 13:20:34 PM','yyyy-mm-dd hh;mi:ss AM'));
    执行时仍然报错,请教这是什么问题,该如何解决,多谢