Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql SAS代码效率_Sql_Sas - Fatal编程技术网

Sql SAS代码效率

Sql SAS代码效率,sql,sas,Sql,Sas,有人可以帮助我了解SAS/SQL如何处理嵌套查询或子查询吗。它是只执行一次内部选择,“从主文件选择总和(价格)”还是每次迭代外部查询 proc sql; create table categorySpend as select categoryid, sum (price) as CategoryRevenue, (select sum(price) from MasterFile)as TotalRevenue from MasterFile group by categoryid;

有人可以帮助我了解SAS/SQL如何处理嵌套查询或子查询吗。它是只执行一次内部选择,“从主文件选择总和(价格)”还是每次迭代外部查询

proc sql; 
create table categorySpend as 
select categoryid, sum (price) as CategoryRevenue, (select sum(price) from MasterFile)as TotalRevenue 
from MasterFile 
group by categoryid; 
quit;

了解幕后情况的最佳方法可能是在
proc sql
语句中使用未记录的
\u方法和
\u树
选项。对于非常详细的总结,这是一个很好的来源: