关于时间的模糊查询
2007-09-06 09:56
357 查看
我现在要做一个时间的模糊查询,我写了如下语句,但怎么都通不了
sql=select * from numbers where refertime like '%2001-11-26%'
该语句没有语法错误,记录中有有关的记录。refertime 的值为年-月-日 时:分:秒
修改为:
Select * From numbers Where convert(char(10),refertime ,121) ='2001-11-26'
oracle 时间的查询
select * from t_pms_project_closure t where t.apply_date=to_date('2007-6-25 14:37:28','yyyy-MM-dd HH24:MI:SS')
select * from t_pms_project_closure t where t.apply_date like to_date('2007-6-25','yyyy-MM-dd')
select * from t_pms_project_closure t where to_char(t.apply_date,'HH24:MI:SS') = '14:37:28'
select * from t_pms_project_closure t where to_char(t.apply_date,'HH24') = '14'
insert into t_pms_project_closure t
(
t.project_closure_id,
t.apply_date,
)
values
(
'62329fab-eedc-4d8d-859c-2613516a5015',
to_date('2007-6-25 14:37:28','yyyy-MM-dd HH24:MI:SS'),
)
sql=select * from numbers where refertime like '%2001-11-26%'
该语句没有语法错误,记录中有有关的记录。refertime 的值为年-月-日 时:分:秒
修改为:
Select * From numbers Where convert(char(10),refertime ,121) ='2001-11-26'
oracle 时间的查询
select * from t_pms_project_closure t where t.apply_date=to_date('2007-6-25 14:37:28','yyyy-MM-dd HH24:MI:SS')
select * from t_pms_project_closure t where t.apply_date like to_date('2007-6-25','yyyy-MM-dd')
select * from t_pms_project_closure t where to_char(t.apply_date,'HH24:MI:SS') = '14:37:28'
select * from t_pms_project_closure t where to_char(t.apply_date,'HH24') = '14'
insert into t_pms_project_closure t
(
t.project_closure_id,
t.apply_date,
)
values
(
'62329fab-eedc-4d8d-859c-2613516a5015',
to_date('2007-6-25 14:37:28','yyyy-MM-dd HH24:MI:SS'),
)
相关文章推荐
- 关于时间的模糊查询 mysql
- 关于时间模糊查询的三种方法
- 关于SQL时间类型的模糊查询
- 关于SQL和HQL时间类型的模糊查询
- 关于SQL时间类型的模糊查询
- 关于SQL模糊查询日期时间的方法
- 有关于时间的模糊查询
- 关于SQL时间类型的模糊查询 .
- 关于SQL时间类型的模糊查询
- 关于SQL时间类型的模糊查询
- 关于SQL时间类型的模糊查询
- 关于用时间模糊查询的三种方法
- 关于SQL时间类型的模糊查询
- mybatils oracle和sqlserver数据库时间模糊查询
- Sql Server关于日期查询时,如果表中日期到具体某个时间
- oracle关于日期时间的查询
- 关于 mybatis 的模糊查询
- springboot使用JPA时间类型如何模糊查询
- 关于和Access数据库模糊查询Like
- SQL 时间类型的模糊查询