Help using Base SAS procedures

PROC SQL : oppesite of JOIN

Reply
N/A
Posts: 1

PROC SQL : oppesite of JOIN

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

Trusted Advisor
Posts: 3,212

Re: PROC SQL : oppesite of JOIN

Posted in reply to suicidedoor

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

---->-- ja karman --<-----
Respected Advisor
Posts: 4,173

Re: PROC SQL : oppesite of JOIN

Posted in reply to suicidedoor

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

Trusted Advisor
Posts: 1,319

Re: PROC SQL : oppesite of JOIN

Posted in reply to suicidedoor

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

image.jpg

Moderator
Posts: 252

Re: PROC SQL : oppesite of JOIN

Posted in reply to suicidedoor

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

Super Contributor
Posts: 297

Re: PROC SQL : oppesite of JOIN

Posted in reply to suicidedoor

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.

Ask a Question
Discussion stats
  • 5 replies
  • 8550 views
  • 3 likes
  • 6 in conversation