• Blog posts

    Bio

    By David Crowther

    PostGIS___Distinct_Values_-_1.JPG

    Question:

    How can you identify Distinct Values in a Column in PostGIS?

    Answer:

    If you wish to identify the Distinct/Unique values in a column of data in a PostGIS table, use the following SQL statement in a Query Window:

    PostGIS___Distinct_Values_-_2.JPG

    Simply replace:

    • columnname – with the field in the PostGIS Table
    • schema – with the schema in the database that the Table is stored
    • tablename – with the table name

    If you now Run the query all the Distinct Values in the defined column will be shown:

    PostGIS___Distinct_Values_-_3.JPG