假设有这么一个表,表名为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'));
执行时仍然报错,请教这是什么问题,该如何解决,多谢
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'));
执行时仍然报错,请教这是什么问题,该如何解决,多谢
lalakid(梦想总是那么美好……)的解答不对
就是24小时的啊!
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
2 from dual;TO_DATE('2007-05-20
-------------------
2007-05-20 13:20:34
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'));
执行时仍然报错,请教这是什么问题,该如何解决,多谢