BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9


hello

i have 4 tables and i need to join them. The 1st table has about 1M records and the other 3 about 20M each but i only need all the records from the 1st with all the coresponding ones  from the  other 3 tables which means left  join on the 1st table would do the job,right?

But how do i do left join with more then   2  tables? Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

The basic structure is like this:

select a.*, b.x, c.y, d.z

from a left join

  b on a.id=b.id left join

  c on a.id=c.id left join

  d on a.id=d.id

Keep referring to the first table for the joins.

PG

PG

View solution in original post

3 REPLIES 3
morgalr
Obsidian | Level 7


Here is a link to the question asked for MySQL http://stackoverflow.com/questions/7980052/how-to-do-left-join-with-more-than-2-tables

the proc sql syntax should be very similar.

PGStats
Opal | Level 21

The basic structure is like this:

select a.*, b.x, c.y, d.z

from a left join

  b on a.id=b.id left join

  c on a.id=c.id left join

  d on a.id=d.id

Keep referring to the first table for the joins.

PG

PG
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9


thanks. This is really siimple

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1200 views
  • 5 likes
  • 3 in conversation