作者liton (欧吉桑留学生)
看板Statistics
标题Re: [问题] SAS proc sql的问题
时间Fri Apr 10 18:32:43 2009
※ 引述《hanjing (心宽念纯)》之铭言:
: ※ 引述《west1996 (焦了六年变脆了)》之铭言:
: : 刚刚推文漏了一行
: : 改用回的好了
: : proc sql;
: : creat table c as
: : select coalesce(a.var1,b.var1) label='var1',a.var2,b.var3
: : from a full joint b
: : on a.var1=b.varl;
: : quit;
: 我试了
: proc sql;
: create table c as
: select coalesce( d003.f1,d004.f1 ) label='f1',d003.f2,d004.f3
: from d003 full join d004 on d003.f1=d004.fl;
: quit;
: 出现了error
: ERROR: Column fl could not be found in the table/view identified with the
: correlation name D004.
: ERROR: Column fl could not be found in the table/view identified with the
: correlation name D004.
: ERROR: Expression using equals (=) has components that are of different data
: types.
感觉是colesce有问题
http://www.techonthenet.com/oracle/functions/coalesce.php
full join的话就是要同时存在於两个table
你写a.var1跟b.var1其实是一样的
你要用var1当FK
又要if then两个table的 var1
我个人感觉是会出包
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.167.175.84
1F:推 west1996:可是我是照SAS出的course note上面改的 以前看的时候没 04/10 19:11
2F:→ west1996:有问题 晚点跑跑看好了 04/10 19:11
3F:推 west1996:刚刚用自己做的data跑过是ok的 所以问题可能不是出在 04/11 18:50
4F:→ west1996:coalesce身上 04/11 18:50