06-08-2016 10:52 AM - last edited on 06-08-2016 02:14 PM by Reeza
Can some one help me with below query. I have 1st dataset with three variables.
Id, date, term
I have second dataset with below three variables.
For both the dataset ID is the primary key variable. I would like to write a query to output when TERM is not equal to TERM1. Term and Term1 will not be same sorting order for one to one match.
The output should look like this.
12004002 TRAMADOL UN/AUG/2014
12004002 MICONAZOL 18/JAN/2016
06-08-2016 03:09 PM
This may give what your are looking for if I understand the problem:
proc sql; create table want as select table1.id, table1.term,table1.date, table2.term1 from table1 left join table2 on table1.id=table2.id where table1.term ne table2.term1; quit;