我有一个表[stable]在一年当中发生的数据,时间列名为:[sDate]格式为:[Date],现在我想查询出3种结果,1.当日的数据,2.当周的数据,3.当月的数据,请各位大大帮帮忙...

解决方案 »

  1.   

    trunc(sDate,'') = trunc(sysdate,'')
      

  2.   

    楼上的大大能不能帮帮忙写的详细点呢,我SQL语句的功底很差的...谢谢了
      

  3.   

    当日,trunc(sDate,'dd') = trunc(sysdate,'dd')
    当周,trunc(sDate,'ww') = trunc(sysdate,'ww')
    当月,trunc(sDate,'mm') = trunc(sysdate,'mm')
      

  4.   

    select * from stable where trunc(sDate,'dd') = trunc(sysdate,'dd');
    ...
    ...