select tasks_reporting_day,to_char(tasks_reporting_day, 'yyyy') year, to_char(tasks_reporting_day, 'MM') month, tO_CHAR(tasks_reporting_day,'W') weekfrom TASK_MAINTENANCE${if(len(年)==0,""," and TO_CHAR(year, 'yyyy') = '"+年+ "'")}${if(len(月)==0,""," and TO_CHAR(month, 'MM') = '"+月+ "'")}${if(len(周次)==0,""," and TO_CHAR(week, 'W') = '"+周次+ "'")}各位大神看看我的sql,我觉得没啥毛病啊,年月是根据tasks_reporting_day这个字段拆分出来的