Comment compter les différentes lignes de MySQL? (trois colonnes dans son ensemble)

StackOverflow https://stackoverflow.com/questions/1908166

  •  19-09-2019
  •  | 
  •  

Question

Comment compter les lignes avec des valeurs distinctes sur l'une des trois colonnes: col1, col2, col3

Était-ce utile?

La solution

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

Autres conseils

aveugle coup:

SELECT count(*) FROM YourTable
WHERE  Col1 <> Col2 OR Col1 <> Col3 OR Col2 <> Col3
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top