+++求一个SQL语句:查询time介于time1和time2之间的记录~!+++

andy2001p 2003-08-11 01:52:13
+++求一个SQL语句:查询time介于time1和time2之间的记录~!+++
...全文
39 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanj1975 2003-08-11
  • 打赏
  • 举报
回复
例如查询表A中的state_date字段的时间在2003年8月1日12点38分33秒到2003年8月10日15点15分15秒之间的记录,语句如下:
select * from A where state_date between to_date('03-08-01 12:38:33','yy-mm-dd hh24:mi:ss') and to_date('030810 15:15:15','yymmdd hh24:mi:ss');

此语句等价于:
select * from A where state_date>=to_date('03-08-01 12:38:33','yy-mm-dd hh24:mi:ss') and state_date<=to_date('030810 15:15:15','yymmdd hh24:mi:ss');
andy2001p 2003-08-11
  • 打赏
  • 举报
回复
up

6,108

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 数据库报表
社区管理员
  • 数据库报表社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧