I'm using the following sql to try and get back my data in a specific way.
I want a list of my projects and a access level next to each project that the user has access. If he doesn't I want a missing value. This is the code I am using and it only returns back rows where the pid's are equal like an inner join.
proc sql ;
Select a.pid, b.access
From project a LEFT JOIN UserPrjAccess b on (a.pid = b.pid)
where b.Userid = 1
I need the output like this
I know i'm missing something basic but I can't find it.
Suggest you also share an input data example, possibly using instream data-points (DATA steps using DATALINES along with requisite INPUT statement) for both of your files WORK.Project and WORK.UserPrjAccess. Also, the WHERE clause is testing a numeric value of 1 - for what purpose in this exercise -- is that an individual's USERID?
Recommended Google advanced search argument, this topic/post: