我目前正在做一个报表,查询前一天彩信转发数量。不知道该怎样写SQL语句?
     各位兄弟姐妹谁能帮帮我。。

解决方案 »

  1.   

    select count(*) from table where 发送时间 = getDate() - 1
      

  2.   

    select count(*) from xxtable where sendtime >= to_date('2010-08-22', "YYYY-MM-DD") and sendtime < to_date('2010-08-23', "YYYY-MM-DD"); 
      

  3.   

    select count(*) from table where 发送时间 = 你选择的日期 and userNumber = '你选择的号码'
      

  4.   


    select count(*) from 你的表   where 发送时间 = 你选择的日期-1  and userNumber = '你选择的号码'
      

  5.   

         各位不好意思,我的前台页面时间是一个日历控件。现在要根据用户选择的日期查询整个月的彩信转发数量。我现在的问题是因为日历控件的格式是yyyy-MM-dd  而我要查询的是不管用户选择的是哪一个日期,都要把整个月的数据查询出来。应该怎么弄啊 
         急。