优化这句sql,DELETE obp, obd, obc FROM OUTGO_BUS_PLAN obp,OUTGO_BUS_DEST obd,OUTGO_BUS_CUSTOM obc WHERE obp.TRAVEL_MONTH IS NULL > ORA-00933: SQL command not properly ended
时间: 2024-01-18 11:04:25 浏览: 184
你可以尝试将你的SQL查询改写为以下形式来优化它:
```sql
DELETE obp, obd, obc
FROM OUTGO_BUS_PLAN obp
JOIN OUTGO_BUS_DEST obd ON obp.PLAN_ID = obd.PLAN_ID
JOIN OUTGO_BUS_CUSTOM obc ON obd.PLAN_ID = obc.PLAN_ID
WHERE obp.TRAVEL_MONTH IS NULL;
```
这样的改写利用了连接(JOIN)语句,使得查询更加清晰且易于优化。请确保每个表之间的连接条件被正确指定。
阅读全文