就是按年度查询本年度的所有记录,在加数据到数据库是,时间的格式是 yyyy-MM-dd, 然后查询的时候是按年查询,查询本年的所有记录~

解决方案 »

  1.   

    select * from tab 
    where to_char(日期,'yyyy')=to_char(sysdate,'yyyy');
      

  2.   

    对了,我用的是ORACLE的数据库哦
      

  3.   

    SQL> select to_char(sysdate,'yyyy') from dual;TO_C
    ----
    2009看看to_char,to_date函数,这些都是oracle中的
      

  4.   

    select * from tab where creation_date between to_date('&from','yyyy-mm-dd') and to_date('&end','yyyy-mm-dd')
    /
    /*
    creation_date记录生成日期 我不知道是不是有creation_date这个函数
    */
      

  5.   

    不知道是否理解的正确,可以用如下方法:
    select * from table where to_CHAR(RQ,'YYYY')='2009'
      

  6.   


    select * from table where to_CHAR(RQ,'YYYY')=:as_year   --'2009'