Answer the question
In order to leave comments, you need to log in
How to count same values in multiple columns?
Good day, friends. Can you please tell me how to calculate the same values in several columns?
There is a datanum table, it has columns number1, number2, number3, number4 - they contain digital data.
I need to count the same values in all four columns, how to do it?
To count in one column, I do this:
SELECT number1,COUNT(*) AS total FROM datanumGROUP BY number1 ORDER BY total DESC LIMIT 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question