Chapter 7. Coding Complex Queries

7.1Introduction 204
7.2Introducing Complex Queries 204
7.3Joins 205
 7.3.1 Why Joins Are Important 205
 7.3.2 Information Retrieval Based on Relationships 206
 7.3.3 Types of Complex Queries 206
7.4Cartesian Product Joins 208
7.5Inner Joins 209
 7.5.1 Equijoins 209
 7.5.2 Non-Equijoins 212
 7.5.3 Reflexive or Self Joins 213
 7.5.4 Using Table Aliases in Joins 216
 7.5.5 Performing Computations in Joins 217
 7.5.6 Joins with Three Tables 218
 7.5.7 Joins with More Than Three Tables 220
7.6Outer Joins 223
 7.6.1 Left Outer Joins 224
 7.6.2 Right Outer Joins 227
 7.6.3 Full Outer Joins 228
7.7Subqueries 230
 7.7.1 Alternate Approaches to Subqueries 230
 7.7.2 Passing a Single Value with a Subquery 232
 7.7.3 Passing More Than One Row ...

Get PROC SQL: Beyond the Basics Using SAS® 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.