gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 19:01:45 24 4
gpt4 key购买 nike

我最想取回文本。

示例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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com