views:

73

answers:

2

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

+4  A: 
SELECT  COUNT(DISTINCT col1, col2, col3)
FROM    mytable
Quassnoi
it works! thanks you!
lovespring
A: 

Blind kick:

SELECT count(*) FROM YourTable
WHERE  Col1 <> Col2 OR Col1 <> Col3 OR Col2 <> Col3
Rubens Farias