颜非如玉 发表于 2012-11-24 21:55 
让我们情何以堪啊?百度一下,结果百度出你的提问了。。。
proc sql;
create table new as
select *
from sashelp.class
where name ? "A";
QUIT;
data demo1;
name1="ABC";sex=1;output;
name1="DEF" ;sex=0;output;
run;
data demo2;
name2="B";output;
name2="C";output;
name2="E";output;
run;
proc sql;
create table want as
select *
from demo1 as a , demo2 as b
where a.name1 ?b.name2;
quit;
log:
NOTE: The execution of this query involves performing one or more Cartesian product joins that can not be optimized.
NOTE: Table WORK.WANT created, with 3 rows and 3 columns.
因为是多表查询,应该会产生笛卡尔集。上面的简单的测试是可以跑出结果的。