Skip to content
Advertisement

How to get unique value in Oracle

My Query:

Output:

Here in above output i want to have unique value only for column ‘document name’ that is PDxxxx. there are multiple values for column process name so wanted to have just one.

Advertisement

Answer

If you want one (any) process name, then take e.g. “first” or “last” (min or max), but you’ll have to aggregate on all other columns (which also means that you don’t need unique any more):

Also, you’d rather not compare dates to strings; that’s why I used date literal in where clause. Finally, switched to JOIN.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement