刚用oracle不太熟 如何多表关联删除数据? WITH t AS ( SELECT DEPARTMENT_ID,SUREDATE,MIN(GOAL) GOAL FROM FR_T_GOAL_DAILY WHERE DEPARTMENT_ID='100686' GROUP BY DEPARTMENT_ID, SUREDATE HAVING count(1) >1 ) DELETE FROM FR_T_GOAL_DAILY WHERE EXISTS( SELECT 1 FROM FR_T_GOAL_DAILY a WHERE a.DEPARTMENT_ID=t.DEPARTMENT_ID AND a.SUREDATE=t.SUREDATE AND a.goal=t.goal ) 这么写不行 with as 之后一定要select吧? 请问如何从FR_T_GOAL_DAILY表中 把在t表中的数据删除删除 请指教~ |
最佳回答 |
||||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|