Database |> Language |> Types |> Keywords |> 

DISTINCT

Contents

Definition

When you’re only interested in output rows with a value (or combination thereof) that’s distinct from others, then the DISTINCT keyword may be what you’re looking for.

Single column

Say you were working on a website with duplicate values in the name column, then you can simply state that you’re interested in rows with DISTINCT name:

container <| ... |
name <| ... |

FROM url
|> GROUP BY container
|> SELECT name
|> DISTINCT name

Combination of columns

Say you are working on a website where pairs (or tuples etc) of values are what you’re specifically interested in having distinct groups of, then separate them by commas:

container <| ... |
first_name <| ... |
email <| ... |

FROM url
|> GROUP BY container
|> SELECT first_name, email
|> DISTINCT first_name, email

Related: