I wish to find out the count of distinct rows in a MySQL DB.
id | val1 | val2 | val3
1 | 1 | 1 | 1
2 | 1 | 1 | 1
3 | 2 | 2 | 2
4 | 2 | 2 | 2
On the table above the query would return
val1 | val2 | val3 | count
1 | 1 | 1 | 2
2 | 2 | 2 | 2
Does anyone know a reasonably efficient way of achieving this in MySQL.