DISTINCT and Unique column with strapi

Easy achievable =) Here’s an example, where you have a table races taking place in different regions. Now you want to retrieve all possible regions within the races table. So you need distinctOn() function.
You can find further documentation on KnexJs website: Knex Query Builder | Knex.js

ATTENTION
KnexJs tells us, that this is a Postgres only feature.

const regions = await strapi.db.connection
      .table('races')
      .select('region')
      .distinctOn('region')