postgresql distinct count code example
Example 1: postgresql distinct
SELECT
DISTINCT bcolor
FROM
distinct_demo
ORDER BY
bcolor;
Example 2: postgres count distinct
SELECT
COUNT(DISTINCT column)
FROM
table_name
WHERE
condition;
SELECT
DISTINCT bcolor
FROM
distinct_demo
ORDER BY
bcolor;
SELECT
COUNT(DISTINCT column)
FROM
table_name
WHERE
condition;