gpt4 book ai didi

mysql - SELECT * FROM Table WHERE col 至少有 3 个相同

转载 作者:行者123 更新时间:2023-11-29 04:12:34 25 4
gpt4 key购买 nike

我需要一个 MySQL 查询,该查询返回表的结果,其中特定列的元素在至少“n”条记录中是相同的。

示例伪代码:

SELECT * FROM Table WHERE col has at least 3 identical

最佳答案

select * from table where col in (
select col from table group by col having count(*) > 3
)

关于mysql - SELECT * FROM Table WHERE col 至少有 3 个相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6414945/

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