select * from table where to_char(posttime,'yyyy-mm-dd hh24:mi:ss')='2005-08-18 17:10:11'

解决方案 »

  1.   

    where posttime=to_date('2005-8-18 17:10:11','yyyy-mm-dd hh24:mi:ss')
    或者
    where trunc(posttime)=to_date('2005-8-18','yyyy-mm-dd')
      

  2.   

    select * from table where to_char(posttime,'yyyy-mm-dd')='2005-08-18'
    这样查出来的数据有2005-8-18 17:10:11,也许也有2005-8-18 17:10:12的记录,是这样吗?
      

  3.   

    select * 
    from table
    where to_char(posttime,'yyyymmdd') = '20050818'
    可以查到你要的20050818的数据
      

  4.   

    请问Oracle中根据某个字段排序后再取前10条记录的语句怎么写,请各位大侠赐教。
      

  5.   

    select * from
    (
    select *
    from table_name
    order by col_name
    )
    where rownum < 11