SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

PROC SQL Joins on 3 Tables

Reply
Regular Contributor
Posts: 181

PROC SQL Joins on 3 Tables

How can we use LEFT JOIN when we have more than 2 tables? PROC SQL equivalent code for the following merge statement code?l

Data abc;

merge a (in=X) b c;

by id;

if X;

run;

Super User
Posts: 3,108

Re: PROC SQL Joins on 3 Tables

proc sql

  create table abc as

  select *

  from a

  left join b

  on a.id = b.id

  left join c

  on a.id = c.id;

quit;

Ask a Question
Discussion stats
  • 1 reply
  • 2084 views
  • 1 like
  • 2 in conversation