distinct - Return one row per unique value
The distinct
operator returns one row for each unique value. This is especially useful for reporting purposes.
Note
This operator is functionally identical to groupby
without any aggregate functions.
Syntax
Example - Get list of active users
If we want to see a list of the users who have been active in a given timeframe, we can use the distinct
operator to produce a list of unique usernames:
This will produce a list of unique usernames:
Theme
Light