I have a postgresql table with columns that have repeating data like this which was created using a django model:
In order to get distinct values of a column, we use a postgre command something like this:
SELECT distinct degree_code FROM studentapp_deg_course_cat
But i want to get this data as an array using python. How do i get distinct objects from the columns of a table in python?
select distinct
doesn't change how you retrieve it. you'll get 0 or more rows of data that you fetch and store.