O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the INTERSECT Set Operator

Overview

The set operator INTERSECT does both of the following:
  • selects unique rows that are common to both tables
  • overlays columns.
overlays columns
The following example demonstrates how INTERSECT works when used alone and with the keywords ALL and CORR.

Using the INTERSECT Operator Alone

The INTERSECT operator compares and overlays columns in the same way as the EXCEPT operator, by column position instead of column name. However, INTERSECT selects rows differently and is displayed in output the unique rows that are common to both tables. The following PROC SQL set operation uses the INTERSECT operator to combine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required