Let us examine the following simple delete statement with two from clauses:
delete from t2
from t1 as t2
The surprising result of execution of this query is the deletion of rows from table t1, and not from table t2 as expected.
To see that I'm not mistaken here, I've referred to the MSDN documentation at, http://msdn.microsoft.com/en-us/library/ms189835.aspx.
It specifically states that the table in the first from is "the name of the table or view from which the rows are to be removed", and that the second from clause "allows specifying data from <table_source> and deleting the corresponding rows from the table in the first FROM clause."
I wonder why the actual behavior is different?
Is this kind of behavior is by design? And if so, is there a mistake in the documentation?