我最想取回文本。
示例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/