我想根据自动获得时间的字段查询该怎么写语句呢?
时间字段类型,设计的是blob
select image from oldImage where id = '2' and imagetime like '%2010-12-2 9:51:01%'
这条语句什么也查不出来,但是字段image是有图片数据的呀

解决方案 »

  1.   

    时间字段用blob类型 我的天啊 
    select count(*) from oldImage where id = '2' and imagetime like '%2010-12-2 9:51:01%'
    --这样的结果是多少
      

  2.   

    我说错了,是要查的字段是blob
    时间字段是date
      

  3.   

    --如果这样也为0就说明没有符合条件的记录
    select count(*) from oldImage 
    where id = '2' and imagetime=to_date('2010-12-02 09:51:01','yyyy-mm-dd hh24:mi:ss')
      

  4.   

    You can try this sentence:
    select image from oldImage where id = '2' and To_char(imagetime,'MM-DD-YYYY:HH:MM:SS') = '12-02-2010:09:51:01'