Yesterday, we found that the data analysis results in the program were incorrect. After the analysis was performed again, the original data was still there and the fields with values were accumulated. The heart said, No, It was analyzed only after record generation. Forgot to DELETE? Check the code and find a delete statement. Therefore, the query analyzer executes the statement and reports an error. I have tried it several times. Now, Delete From does not recognize the table name alias! Looking back, after the program was changed, it was mainly tested in Oracle. SQLServer has not been tested in detail.
The alias is used because the where condition requires the use of subqueries to write some conditions. The following statements are not as complex as they are described below.
Conclusion:
(Applicable to ORACLE) delete from tablea a where a. FIELD1 = 10
(For SQLSERVER) delete tablea from tablea a where a. FIELD1 = 10
(Ora \ SQL applies) DELETE FROM TABLEA WHERE TABLEA. FIELD1 = 10
Two points of experience:
1. the test should be comprehensive;
2. Be confident and take into account all the situations when writing a program.
Update Status
Update T_report
Set a. status = '1'
Where a. report_Seq = 1234
Execution failed
Update
Set a. status = '1'
From T_report
Where a. report_Seq = 1234
Execution successful
So do a general program and do not use aliases.