日期:2014-05-17  浏览次数:20839 次

查询的问题



第一句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;