I have a database table in MySql as follows :
myTable
col1 integer
col2 integer
col3 text
There are many more columns in the table, but for my question, these three matter.
What I want to do is that, I want to print the sum of column 1 and column 2. With this, I want to print the string from col3 which has maximum occurrence. If there are more strings with the same occurrence, I want to print which comes first alphabetically. How is that possible in MySql ? Is it even possible in single query? (This can be marked as a homework question. I am trying to figure out the solution but with my current knowledge base I am not able to do it. Some pointers on how it can be solved or some hints will prove helpful.