BookmarkSubscribeRSS Feed
suicidedoor
Calcite | Level 5

Hello,

in my University ive got this task:

ONE

red

green

brown

brown

TWO

purple

green

brown

my goal:

is get the colors who only shown once

with INNER RIGHT LEFT FULL JOIN

in this case

red

purple

i just wanna have a hint

wanna do the rest by my self 🙂

Thanks

5 REPLIES 5
jakarman
Barite | Level 11

SQL INNER JOIN Keyword (just google to study/learning examples)  SAS is supporting Ansi SQL with some minor details being different.

---->-- ja karman --<-----
Patrick
Opal | Level 21

That's quite a good task as it will make you dive into the workings of SQL. One way to go: FULL JOIN with a HAVING clause - and eventually a COALESCE() in the SELECT

Another option here: SAS(R) 9.2 SQL Procedure User's Guide

MichelleHomes
Meteorite | Level 14

The following  image may help you viisualize the various types of SQL joins...

image.jpg

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com
AndrewHowell
Moderator

Hi (suicidedoor?) - do you specifically have to use a JOIN clause. Your desired result could be achieved in SQL using SET operators.

Scott_Mitchell
Quartz | Level 8

You could perform a union all of one and two and then use a count function, group by and having clause to filter the results.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 11686 views
  • 3 likes
  • 6 in conversation