This is hopefully an easy question, but...
I am writing a query where I need to count the distinct combinations of values in two columns
Select col1, col2 from MyTable returns
I need to find the number of different combinations like:
Select distinct col1, col2 from MyTable
which will return:
My problem is how to incorporate COUNT() into the SQL statement.
For instance I can write:
Select count( distinct col1) from MyTable
however this will return 3, instead of 7
I found a reference online to use the concat operator CONCAT or ||, but I haven't beenable to get it to
work with INFORMIX SQL
Example: [DOES NOT WORK UNDER INFORMIX]
Select count( distinct concat(col1, col2) ) from MyTable
SO, I am wondering if there is a better/another way to do this or a trick to make it work under INFORMIX SQL