Problems with subquery, field doesn't exist, but advantage is giving me results

前端 未结 1 1700
青春惊慌失措
青春惊慌失措 2021-01-21 17:56

I have a question on subqueries in advantage. As I was analyzing several SQL queries I stumbled upon a strange situation.

When I executed the following SQL, I got these

相关标签:
1条回答
  • 2021-01-21 18:14

    This is not a bug. It is working correctly.

    The OlwArtnr in the subquery, when not fully qualified, resolves to the OlwArtnr column in the parent query. Unqualified column in the subquery is resolved using the table in the subquery first. If it is not one of the columns from the tables in the subquery, it will go to the parent query, using the tables in the parent query. This process continues up the chain until either the column resolves to a table or an error is generated.

    You will get the same with SQLServer or other database.

    0 讨论(0)
提交回复
热议问题