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?
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
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.
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
thanks. This is really siimple
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.