gpt4 book ai didi

MySQL:排除重复数据

转载 作者:行者123 更新时间:2023-11-29 04:03:50 26 4
gpt4 key购买 nike

在我的一个专栏中,有重复的内容,我只想抓取第一次出现的内容。我怎样才能做到这一点?在示例中,我想获取 C 列中唯一的所有行。所以我只想要 hello ladieshello teamhello cats你好性感

Example Table
---------------

column A | col B | col C
--------------------------
hello | ladies| 1
hello | guys | 1
hello | team | 2
hello | dogs | 2
hello | cats | 3
hello | cats | 3
hello | sexy | 4

最佳答案

使用 distinct() 命令。

select distinct(colc), cola, colb from table 

这只会选择唯一值

关于MySQL:排除重复数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5510034/

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