Tutorial by Examples

Vertical join appends dataset B to dataset A providing both of them have similar variables. For example, we have sales for the month of Jan'17 in dataset A and sales for Feb'17 in dataset B. To create a dataset C that has sales of both Jan and Feb we use Vertical Join. PROC SQL; CREATE TABLE C AS ...
Inner join creates a dataset that contains records that have matching values from both the tables. For example, we have a dataset A that contains customer information and a dataset B that contains credit card details. To get the credit card details of customers in dataset A, let us create dataset C ...
Left join returns all the observations in the left data set regardless of their key values but only observations with matching key values from the right data set. Considering the same example as above, PROC SQL; CREATE TABLE C AS SELECT A.*, B.CC_NUMBER, B.START_DATE FROM CUSTOMER A LEFT JOIN CC...
Like left join, right join selects all the observations from the right dataset and the matched records from the left table. PROC SQL; CREATE TABLE C AS SELECT A.*, B.CC_NUMBER, B.START_DATE FROM CUSTOMER A RIGHT JOIN CC_DETAILS B ON A.CUSTOMERID=B.CUSTOMERID QUIT; Dataset C contains all the...
Full join selects all the observations from both data sets but there are missing values where the key value in each observation is found in one table only. PROC SQL; CREATE TABLE C AS SELECT A.*, B.CC_NUMBER, B.START_DATE FROM CUSTOMER A FULL JOIN CC_DETAILS B ON A.CUSTOMERID=B.CUSTOMERID QUI...

Page 1 of 1