我写的
dataProduct;
inputProduct_id Product;
datalines;
1 1001
2 1002
3 1003
;
dataSales;
inputProduct_id Sales;
datalines;
3 100
1 200
5 100
1 200
3 100
1 100
;
以下我copy机经上的code,
Proc sql;
Select p.product,s.totalsales
From product as p
left join (
select sum(sales)as totalsales
from sales as s)
onp.product_id=s.product_id;
quit;
不能得到以下结果。
Whatis the output?
Answer:
ProductTotalsales
1001500
1002.
1003 200
406 Proc sql;
407 Select p.product, s.totalsales
408 From product as p
409 left join (
410 select sum(sales) as totalsales
411 from sales as s)
412 on p.product_id=s.product_id;
ERROR: Column totalsales could not be found in the table/viewidentified with the correlation
name S.
413 quit;
NOTE:The SAS System stopped processing this step because of errors.
NOTE:PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.01