let say I have this table
no | date | no1 | no2 | no3 |
------------------------------------------
01 | 1993-05-01 | 0019 | 1124 | 0592 |
02 | 1993-05-02 | 1234 | 4221 | 5543 |
03 | 1993-05-03 | 4321 | 0019 | 0019 |
04 | 1993-05-04 | 0019 | 1112 | 6876 |
What MySQL Query will return the most repeated number and sort them by latest date?
You would need to “flatten” you data set first. You can do this by running 1 query for each column, then doing a UNION and a SELECT on the unions with a group by.