首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

怎么根据时间来查询,给个具体点的例子吧

2011-12-21 
如何根据时间来查询,给个具体点的例子吧最好来一段hql代码的例子,当然别的也行,不过得写清楚。谢了![解决办

如何根据时间来查询,给个具体点的例子吧
最好来一段hql代码的例子,当然别的也行,不过得写清楚。谢了!

[解决办法]
按时间查询?
select *
from bxs.v_bxs_pol_mst t
where t.create_date > = '20060101 ' and
t.create_date <= '20061231 '
[解决办法]
hql 映射的是哪种数据库
mssql 的话,

from tablename t where t.c_date between '1900-01-01 ' and '1999-01-01 '

oracle 的话
from tablename t where t.c_date between to_date( 'yyyy-mm-dd hh24:mi:ss ',
'1900-01-01 12:12:!2 ') and to_date( 'yyyy-mm-dd hh24:mi:ss ', '1999-01-01 12:12:!2 ')

热点排行