@arnoldo.moen
To count unique values across two columns with certain types in PostgreSQL, you can use the following query:
1 2 3 |
SELECT COUNT(DISTINCT (col1, col2)) FROM your_table WHERE col1::text = 'certain_type' AND col2::text = 'certain_type'; |
Explanation:
This query will count the number of distinct combinations of values in col1
and col2
that match the specified type in both columns.