Good evening all,
I have an question in inner join ,
I have performed inner join like this
proc sql;
create table combine as
select distinct
n.apple,
p.vegges
from
fruits as n
inner join
vegetables as p
on
n.key=p.key;
quit;
Now in vegges column I have carrots,beans,brocoli,beets--I like my data only to have carrot and beans , how will I apply this condition here.
Thank you
S
You probably just need a WHERE clause just before the semi-colon.
WHERE vegge IN (carrot, beans)
However, remember that if you're doing an Inner join, only items found in both tables will be present in the results set. I'm not sure that carrot or beans will be found in an Inner join with fruits.
Jim
Thanks for the reply.
Appreciate it.
How will I address this issue if not inner join
I have 2 tables A and B
A has Vehicle,Bus,Train
B has Vehicle,road,car
In B table I need only Toyota , camry from car variable
I can join these tables by vehicle as an common variable
How should I approach this condition?
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.