Before asking this question, I searched with Google, but I could not understand, or maybe I could not find a solution suitable for my situation.
So, I have one table with 10 columns, I want to remove duplicates from the select result. And as a result, all columns that have a unique userID should be presented
+ ----------------------------------- + ------ + ------ --------------- + ------ +
| name | yr | some Columns | userID |
+ ----------------------------------- + ------ + ------ --------------- + ------ +
| abc | 2000 | | 10 |
| jack | 2000 | | 11 |
| dadas | 2000 | | 12 |
| jack | 2004 | ............. | 11 |
| jack | 2000 | ........... | 11 |
| nell | 2006 | ............. | 13 |
| ...... | 2000 | ............. | 1 |
| ............. | 2000 | ............. | 2 |
| again | 2000 | ............. | 3 |
| again | 2000 | | 3 |
| ....... | 1973 | ............. | 2 |
| abc | 2000 | | 10 |
sql select postgresql distinct
Γzbek
source share