Skip to content
Advertisement

Tag: distinct

SELECT rows with a new DISTINCT from a VARCHAR with CSV in it

I have an Oracle database table with a field called Classification which is VARCHAR. The VARCHAR is a CSV(using semi colons). Example: I want to pull all the rows with ONLY a different value in the CSV from the others. It is ok if a row has a previously found value as long as it has a new different value.

How to count number of groups?

I have a table as follow: I want to count the number of distinct g_n. (Here it’s 3.) I have tried with: But it gives me the number of items per group. How can I count the number of distinct g_n? Answer Use count(distinct): There is no need to aggregate using group by for this result. Note: This ignores NULL

Advertisement