Skip to content

Instantly share code, notes, and snippets.

@Raffo
Last active May 11, 2018 19:44
Show Gist options
  • Save Raffo/d1fc06fab39988603fd9 to your computer and use it in GitHub Desktop.
Save Raffo/d1fc06fab39988603fd9 to your computer and use it in GitHub Desktop.
Oracle

Oracle SQL distinct on single column

 select * 
 from TABLE_NAME 
 where rowid in 
  (
    select max(ROWID) 
    from TABLE_NAME 
    GROUP BY COLUMN_NAME
  );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment