Generating a Cartesian Product
The most basic type of join combines data from two tables
that are specified in the FROM clause of a SELECT statement. When
you specify multiple tables in the FROM clause but do not include
a WHERE statement to subset data, PROC SQL returns the Cartesian product
of the tables. In a Cartesian product, each row in the first table
is combined with every row in the second table. Below is an example
of this type of query, which joins the tables One and Two.
proc sql;
select *
from one, two; |
|
The output shown above displays all possible combinations of each row in table One with all rows in table Two. Note that ...
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.