用了hibernate的HQL语句,日期格式出了问题,arrivetime在数据库中是timestamp类型。select new classes.TrainSchedule(id,num, status,cate,fromStation,toStation,leaveTime,arriveTime,late, spent, platform,trainLate) from TrainSchedule trs where trs.arriveTime BETWEEN to_timestamp('1970-01-01 01:00:00.0','YYYY-MM-DD HH24:MI:SS.MS') AND to_timestamp('1970-01-01 12:59:00.0','YYYY-MM-DD HH24:MI:SS.MS') order by trs.arriveTime日期格式无法识别
解决方案 »
- 存储过程返回结果集
- 求一份ORACLE所有权限的中文列表
- oracle snmp 配置问题
- 简单的用户授权问题~我是新手不知道为什么会失败;
- 分区时LESS是小于,等于怎么表示
- 大侠,存储过程中调用存储过程的脚本怎么写?在线等,谢过了先!
- vc ado + oracle 开发 ,一次入2G 数据到一半数据量时客户端cpu利用率100% 就不再入数据了,在线等。。急。。。
- 数据库创建和管理的问题
- 怎样实现oracle数据库的sql脚本,安装的时候直接在sql plus运行,结构和数据都可以创建???
- oracle9i奇怪问题(bug?)
- oracle物化视图失效问题
- 初学者 麻烦求助一个SQL语句 显示 ORA-00936: missing expression
select new classes.TrainSchedule(id,num, status,cate,fromStation,toStation,leaveTime,arriveTime,late, spent,
platform,trainLate) from TrainSchedule trs
where trs.arriveTime BETWEEN to_timestamp('1970-01-01 01:00','YYYY-MM-DD HH24:MI'
and to_timestamp('1970-01-01 12:59','YYYY-MM-DD HH24:MI')
order by trs.arriveTime
--可能少了个括号吧
select new classes.TrainSchedule(id,num, status,cate,fromStation,toStation,leaveTime,arriveTime,late, spent,
platform,trainLate) from TrainSchedule trs
where trs.arriveTime BETWEEN to_timestamp('1970-01-01 01:00','YYYY-MM-DD HH24:MI')
and to_timestamp('1970-01-01 12:59','YYYY-MM-DD HH24:MI')
order by trs.arriveTime
SQL> create table TrainSchedule(
2 arriveTime timestamp
3 );表已创建。SQL> insert into TrainSchedule values(sysdate);已创建 1 行。SQL> insert into TrainSchedule values(to_timestamp('1970-01-01 12:58','YYYY-MM-DD HH24:MI'));已创建 1 行。SQL> select * from TrainSchedule where arriveTime BETWEEN to_timestamp('1970-01-01 01:00','YYYY-MM-DD HH24:MI')
2 and to_timestamp('1970-01-01 12:59','YYYY-MM-DD HH24:MI');ARRIVETIME
---------------------------------------------------------------------------
01-1月 -70 12.58.00.000000 下午