Question

How to count rows with distinct values on any of the three columns: col1, col2, col3?

Was it helpful?

Solution

SELECT  COUNT(DISTINCT col1, col2, col3)
FROM    mytable

OTHER TIPS

Blind kick:

SELECT count(*) FROM YourTable
WHERE  Col1 <> Col2 OR Col1 <> Col3 OR Col2 <> Col3
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top