From the course: SAS® 9.4 Cert Prep: Part 07 Using SQL in SAS

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Creating inner joins in SQL

Creating inner joins in SQL

- [Instructor] Joining tables is a very common need when working with data. There are multiple methods available in SAS to join tables. The most common are SQL and the data step. In this section, you'll learn about the SQL inner join. The SAS Programming 2 course addresses the data step merge. In this example, we have information about students in the class_update table and each student's assigned grade and teacher in the class_teachers table. Notice that the name column is common in both tables. We want to join the tables so that all information for each student is contained in a single result. An inner join creates a new report or a table that includes only the students found in both tables. Notice that David is only in class_update and Carol is only in class_teachers. So they're not included in the inner join result. To combine the matching rows from two tables, we can modify the from clause to add inner join followed by the…

Contents