Hello everybody !! Can somebody explain why I have two different results ? data arq1_; input alfa1 $ ind1; datalines; a 1 a 2 b 1 b 2 b 3 ; run; data arq2_; input alfa2 $ beta2 $ ind2; datalines; a x 1 a y 1 a y 2 a z 1 a z 2 c x 1 ; run; /###################### FIRST METHOD #########################/ I created the table "inline" after that I just did the join with where statement ("arq_join"). proc sql; create table inline as select alfa2,beta2,count() as qte_alfabeta2<br> from arq2_ group by 1,2;</p><p>quit;</p><p> </p><p> proc sql;</p><p>create table arq_join as<br> select alfa1,<br> count() as qte_alfa1, qte_alfabeta2 from arq1_, inline where alfa1=alfa2 group by 1; quit; /###################### SECOND METHOD (USING INLINE) #########################/ I just put the query in the inline view, but a couldn't understand why in this case I have different results. proc sql; create table arq_join2 as select a.alfa1,count()as qte_alfa1,qte_alfabeta2<br>from arq1_ as a,<br> (select b.alfa2,b.beta2,count() as qte_alfabeta2 from arq2_ as b group by 1,2) where alfa1=alfa2 group by 1; quit; I think it's the same query, the second method is just with inline view, isn't ? Why the second method generates different results ? tk's in advanced <span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"><span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"><span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"></span></span></span>
... View more