怎么查询两个时间字段的sql语句 例如:select starttime,endtime from user where ....
就是查询starttime,endtime 之间的数据,求助!

解决方案 »

  1.   

    你的starttime和endtime是兩個字段,還是一個字段的兩個邊界值啊?
      

  2.   

    select * from user where between starttime and endtime ?
    你想要这个,最好说清楚一点,或者举个带数据的例子
      

  3.   

    select * from user
    where to_date('你指定的时间','yyyymmdd hh24:mi:ss')>=starttime
    and  to_date('你指定的时间','yyyymmdd hh24:mi:ss')<endtime
      

  4.   

    >=   <=应该可以用啊