楼主: suly
7766 15

merge 的问题 [推广有奖]

11
suly 发表于 2010-7-21 23:24:47
8# pobel
谢谢。可是还是有错误。
proc sql ;
        create table port as
        select stkcd, year, sale,tacc,ppe,ar,ta,earn,cfo,y,t,c,e
         from repr18
        left join car on repr18.stkcd=car.stkcd and repr18.year=car.year
;
quit;

ERROR: Ambiguous reference, column stkcd is in more than one table.
ERROR: Ambiguous reference, column year is in more than one table.
27   quit;
引用不明确什么意思啊,每个stock变量对应10年呢,每个year变量对应所有的A股呢。

12
suly 发表于 2010-7-21 23:28:00
8# pobel
谢谢。可是还是有错误。
proc sql ;
        create table port as
        select stkcd, year, sale,tacc,ppe,ar,ta,earn,cfo,y,t,c,e
         from repr18
        left join car on repr18.stkcd=car.stkcd and repr18.year=car.year
;
quit;

ERROR: Ambiguous reference, column stkcd is in more than one table.
ERROR: Ambiguous reference, column year is in more than one table.
27   quit;
引用不明确什么意思啊,每个stock变量对应10年呢,每个year变量对应所有的A股呢。

13
BraveMadMan 发表于 2010-7-21 23:32:37
suly 发表于 2010-7-21 23:24
8# pobel
谢谢。可是还是有错误。
proc sql ;
        create table port as
        select stkcd, year, sale,tacc,ppe,ar,ta,earn,cfo,y,t,c,e
         from repr18
        left join car on repr18.stkcd=car.stkcd and repr18.year=car.year
;
quit;

ERROR: Ambiguous reference, column stkcd is in more than one table.
ERROR: Ambiguous reference, column year is in more than one table.
27   quit;
引用不明确什么意思啊,每个stock变量对应10年呢,每个year变量对应所有的A股呢。
引用不明确是说你要的变量存在于多个你引用的数据库,SAS不知道去那个数据库里找你要的变量。

select repr18.stkcd, repr18.year, sale,tacc,ppe,ar,ta,earn,cfo,y,t,c,e
from repr18 left join car on repr18.stkcd=car.stkcd and repr18.year=car.year;
Don't get lost in technical details. What is the big picture?

14
suly 发表于 2010-7-22 00:33:32
proc sql ;
        create table port as
        select repr18.stkcd, repr18.year, repr18.sale,repr18.tacc,repr18.ppe,repr18.ar,repr18.ta,repr18.earn,repr18.cfo,repr18.y,repr18.t,repr18.c,repr18.e
         from repr18
        left join car on repr18.stkcd=car.stkcd and repr18.year=car.year;
quit;
呵呵问题解决了,是因为我在select 变量前没有加数据库的名称。谢谢各位。

15
lavendercao 发表于 2011-8-3 18:02:08
没看懂啊!!

16
xiayuguoguo 发表于 2012-7-31 20:39:21
用merge,在小数据集后面写(in=a);然后写if a;就可以了

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-29 04:19