How to count diffrent rows in MySQL ? (three columns as a whole)
Question
How to count rows with distinct values on any of the three columns: col1
, col2
, col3
?
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