mysql - 获取不同MySQL记录的重复情况

标签 mysql recurrence

我最想取回文本。

示例1:

Column1  Column2 Column3  Column4  Column5
Red      Red     Red       White    Blank

结果查询:

Red

示例2:

Colum1 Colum2  Colum3  Colum4  Colum5
White  White   Red     Yellow  Blank

结果查询:

White

最佳答案

我最近遇到了类似这个问题。希望这会有所帮助。

select col
from
(select col1 as col from tab1
 union all
 select col2 as col from tab1
 union all
 select col3 as col from tab1
 union all
 select col4 as col from tab1
 union all
 select col5 as col from tab1) as new_table
group by col order by count(*) desc limit 1;

关于mysql - 获取不同MySQL记录的重复情况,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43825953/

相关文章:

php - 存储注册时输入的数据

algorithm - 循环的递归关系

algorithm - 求解递归 T(floor[n/2]) + T(ceil[n/2]) + n - 1

algorithm - 具有 2 x 1 和 2 x 2 矩形的平铺网格

mysql - 无法从左连接获取记录 0 :m relationship table

php - 左连接不显示产品

mysql - 如何选择时间戳最新的记录

php - 如何从标签列表的标签栏中准确选择标签?

algorithm - 我的基本案例错了吗? - 多次重复算法的重复关系

algorithm - 递归树和渐近复杂性 : T(n) = T(n/3) + T(n/2) + n