Here is how to get the distinct count of values across all columns in the table:select count(distinct value)from ( select c1 as value from country_test union all select c2 from country_test union all select c3 from country_test union all select c4 from country_test);This uses UNION ALL to unpivot the columns, then counts the distinct values
The Oracle database includes tons of features for developers, and because of that we sometimes miss some of them - good and useful features that many developers either don't know about them or assume they are not supported in their licensed edition or options. This session focuses on such features - introducing them, exploring them, showing when they are useful and how to use them.
Here is how to get the distinct count of values across all columns in the table:select count(distinct value)from ( select c1 as value from country_test union all select c2 from country_test union all select c3 from country_test union all select c4 from country_test);This uses UNION ALL to unpivot the columns, then counts the distinct values
1. The Features That
maybe
You Didn’t Know About
Oren Nakdimon
www.db-oriented.com
oren@db-oriented.com
+972-54-4393763
@DBoriented