Django queryset get distinct column values with respect to other column
问题 I am using django orm and I am trying to get all the values of a column, but only if a different column is unique with respect to it. Its hard to explain, so here is an example: q | a | 1 w | s | 2 e | a | 3 q | a | 4 w | s | 5 e | a | 6 I would like to get all the values that are in column 2 but if they also have the same value in column 1 don't take duplicates. So in this case I want to get [a,s,a]. (column 3 only serves to show why these duplicates don't get merged in the first place).