> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/postgres/select-distinct.md).

# SELECT DISTINCT

The `DISTINCT` clause is used in the `SELECT` statement to remove duplicate rows from a result set.

#### Evaluate one or multiple column by DISTINCT

```sql
SELECT DISTINCT column1, column2 FROM table_name;

// If you do like this it will wrap the value with 2 column for checking duplicate
//example It can query like this

|--column1--|--column2--|
|  test1    |  test2    |
|  test1    |  test3    |
 -----------------------

```

#### Evaluate specific column by DISTINCT

```sql
SELECT DISTINCT ON (column1) , column2 FROM table_name;
// It will return only this one from previos table

|--column1--|--column2--|
|  test1    |  test2    |
 -----------------------
```
