oralce sql的运行顺序 子查询

sql:

select t.username,t.onuattr,t.*
from radius_data_temp t 
where not exists(select '1' from radius_data  a where t.username = a.username and t.onuattr=a.onuattr  ) ;

其中的子查询

(select '1' from radius_data  a where t.username = a.username and t.onuattr=a.onuattr  ) 

问题描述:为什么在括号内可以用在外层的t表。我的认知里sql只能先运行括号内的sql,给括号外的表提供数据。这个sql可运行,但是具体的运行顺序不太懂。还希望有大哥能帮忙答疑,谢谢。

https://zhuanlan.zhihu.com/p/20005249

和编程语言算术表达式类似,先执行括号里面的,因为优先级高,内部数据库会产生临时表。