MySQL Finding most frequent value in multiple columns -


i have table this:

  • votingid president_vote vice_president_vote senator_vote ...
  • 1000 1023 1102 1042
  • 1001 1102 1047 1102
  • 1002 1023 1047 1042
  • ...

so need find person(id) has votes each position, outcome ideally looks this

  • president_vote vice_president_vote senator_vote ...
  • 1023 1047 1042

there 5 columns in table possible find frequent value each column , brutally cross join them all. however, lets assume there 5000 columns exist in table. how can write query find out frequent value appears in each columns together? thanks!


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -