Hello,I need some help with this query.I have a table like this:Col1 Col2---- ----1000 7531001 3951010 32010 39.. ..8019 739
Now, I don't know if there is a 1:1 relationship these values for Col1:Col2, as there are more columns and over a million records in the real table, but I'd like to find out. What I'd like to do is for each value in Col1, find all distinct Col2 values.Here is the current query (not correct at all) that needs to be modified:select col1, col2, count(col2) Col2_Tot_per_Col1from ex_tblgroup by col1, col2having COUNT(col2) > 1order by col1
As an example, for the dataset below:Col1 Col2---- ----1000 7531000 7531001 3951001 3951002 791003 341004 561004 100
I'd like the query to return:Col1 Col2 Col2_Tot_per_Col1 ---- ---- -----------------1000 753 11001 395 11002 79 11003 34 11004 56 21004 100 2
Or, at the very least:Col1 Col2_Tot_per_Col1 ---- -----------------1000 11001 11002 11003 11004 2
Thank you in advance.