I am trying to create a query in sas from postgresql which eliminates duplicate rows based on the value on a subset of columns. Let's assume that my database is as follows:
name var1 var2 var3
   a    1   2   10   
   a    1   2   26   
   b    3   56  47   
   c    4   78  50For my purposes I would like to drop the second row (or the first one, it doesn't really matter) in order to have the table as:
name var1 var2 var3
   a    1   2   10   
   b    3   56  47   
   c    4   78  50I have tried withe the following:
SELECT DISTINCT on (name, var1, var2)
name, var1, var2, var3
FROM table;but without any success, can anyone help?
In Postgresq this would perform the distinct operation considering only the variables name, var1, var2 but keeping name,var1,var2,var3
Thanks
 
                             
                             
                            