oracle timestamp 类型 查询当天 条件

to_char(to_date(to_char(m.create_time_,
                                                     'yyyy-mm-dd hh24:mi:ss'),
                                             'yyyy-mm-dd hh24:mi:ss'),
                                     'dd') = to_char(sysdate, 'dd')
                         and to_char(to_date(to_char(m.create_time_,
                                                     'yyyy-mm-dd hh24:mi:ss'),
                                             'yyyy-mm-dd hh24:mi:ss'),
                                     'mm') = to_char(sysdate, 'mm')
                         and to_char(to_date(to_char(m.create_time_,
                                                     'yyyy-mm-dd hh24:mi:ss'),
                                             'yyyy-mm-dd hh24:mi:ss'),
                                     'yyyy') = to_char(sysdate, 'yyyy')

猜你喜欢

转载自myyuren.iteye.com/blog/1979386