首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

查询的有关问题

2011-12-26 
查询的问题第一句select * from 111 a where a.updt_date like 2011-11-09%第二局select * from 111 a w

查询的问题



第一句select * from 111 a where a.updt_date like '2011-11-09%'

第二局select * from 111 a where a.updt_date between
  to_date(to_char(sysdate - &1, 'yyyymmdd') || ' 00:00:00',
  'yyyymmdd HH24:Mi:SS') and
  to_date(to_char(sysdate - &1, 'yyyymmdd') || ' 23:59:59',
  'yyyymmdd HH24:Mi:SS').

原因,有两天的数据查不到,我where a.updt_date like '2011-11-09%' 就查得到 ,用where a.updt_date='2011-11-09'就查不到。

实现,我要在第二句中加上like,改如何加?



[解决办法]
我弄了一些date类型的字段,并输入了一些模块数据。

SQL code
SELECT * FROM t1; 

热点排行