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.

sas-innovate-2024.png

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.

 

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
  • 5 replies
  • 10749 views
  • 3 likes
  • 6 in conversation