select * from tab where to_char(日期,'yyyy')=to_char(sysdate,'yyyy');
对了,我用的是ORACLE的数据库哦
SQL> select to_char(sysdate,'yyyy') from dual;TO_C ---- 2009看看to_char,to_date函数,这些都是oracle中的
select * from tab where creation_date between to_date('&from','yyyy-mm-dd') and to_date('&end','yyyy-mm-dd') / /* creation_date记录生成日期 我不知道是不是有creation_date这个函数 */
不知道是否理解的正确,可以用如下方法: select * from table where to_CHAR(RQ,'YYYY')='2009'
select * from table where to_CHAR(RQ,'YYYY')=:as_year --'2009'
where to_char(日期,'yyyy')=to_char(sysdate,'yyyy');
----
2009看看to_char,to_date函数,这些都是oracle中的
/
/*
creation_date记录生成日期 我不知道是不是有creation_date这个函数
*/
select * from table where to_CHAR(RQ,'YYYY')='2009'
select * from table where to_CHAR(RQ,'YYYY')=:as_year --'2009'