BookmarkSubscribeRSS Feed
shru
Calcite | Level 5

Hi,

There are four tables which are explicitly joined in a proc sql,can i use three inner joins for the same to get same results

have a little confusion on this.

for example:

proc sql;

select a.*,b.*,c.*,d.*

from ahru as a, dsdf as b,ghdgfs as c,gfgsfs as d

where a.dsss=b.gadfgafd;

;

quit

So for the same can i use three inner joins?

Also,bit curious about what is the maximum inner joins we can use?

Your help is needed

Shru

2 REPLIES 2
RichardinOz
Quartz | Level 8

SQL with inner joins on 4 or more tables is perfectly feasible. You have to be careful that all the joins are stated, to avoid some sort of cartesian product.

In your example you are joining the same table (gfgsfs) twice.  If this is intentional note that the columns represented by d.* are the same as those represented by c.*, and SAS will not allow duplicate column names.  You can rename them on the fly or as a ddataset option if need be.

Richard in Oz

Haikuo
Onyx | Level 15

You can join as many as 32 tables at once if my memory servers me right.

Haikuo

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 738 views
  • 0 likes
  • 3 in conversation