这个sql可以查出来所有的 SELECT a.TASK_LEVEL, a.NUMBER2, a.SUBORDINATE_SYSTEM, a.CONTENT_TASK, a.PLANNED_DELIVERABLES, a.THOSE_RESPONSIBLE, a.COMPLETION_DATE, a.REMAINING_DAYS, a.ACTUAL_COMPLETION_DATE, a.STATE, a.LAST_WEEK_STATE, a.THIS_WEEK_STATE, a.DEPARTMENT, a.TASK_PERSON, a.TASK_CREATE_DAY, a.TASKS_REPORTING_DAY, a.TASK_REPLY_ADDED FROM NEW_REPORT.TASK_MAINTENANCE a
这个嵌套sql查出来一条 SELECT c.TASK_LEVEL, c.NUMBER2, c.SUBORDINATE_SYSTEM, c.CONTENT_TASK, c.PLANNED_DELIVERABLES, c.THOSE_RESPONSIBLE, c.COMPLETION_DATE, c.REMAINING_DAYS, c.ACTUAL_COMPLETION_DATE, c.STATE, c.LAST_WEEK_STATE, c.THIS_WEEK_STATE, c.DEPARTMENT, c.TASK_PERSON, c.TASK_CREATE_DAY, c.TASKS_REPORTING_DAY, c.TASK_REPLY_ADDED, c.FYMONTH, c.FDATE, c.WEEK FROM(SELECT a.TASK_LEVEL, a.NUMBER2, a.SUBORDINATE_SYSTEM, a.CONTENT_TASK, a.PLANNED_DELIVERABLES, a.THOSE_RESPONSIBLE, a.COMPLETION_DATE, a.REMAINING_DAYS, a.ACTUAL_COMPLETION_DATE, a.STATE, a.LAST_WEEK_STATE, a.THIS_WEEK_STATE, a.DEPARTMENT, a.TASK_PERSON, a.TASK_CREATE_DAY, a.TASKS_REPORTING_DAY, a.TASK_REPLY_ADDED, b.FYMONTH, b.FDATE, CASE SUBSTR(b.FMWEEK,7,1) WHEN '1' THEN '第一周' WHEN '2' THEN '第二周' WHEN '3' THEN '第三周' WHEN '4' THEN '第四周' WHEN '5' THEN '第五周' ELSE '第六周' END WEEK FROM NEW_REPORT.TASK_MAINTENANCE a , NEW_REPORT.MDM_TIME b WHERE a.TASKS_REPORTING_DAY = b.FDATE) c
|