如图所示,需求是我想把两列叠加起来或拼接起来,然后用group by 去重,搜的都是concat ,或group_concat ,或sum函数,不符合需求;
后来请教同事,B哥,union 函数;
符合需求。
union 函数还自动去重,union all 是不去重的。
文章标签 mysql 如何根据两列去重 文章分类 MySQL 数据库
如图所示,需求是我想把两列叠加起来或拼接起来,然后用group by 去重,搜的都是concat ,或group_concat ,或sum函数,不符合需求;
后来请教同事,B哥,union 函数;
符合需求。
union 函数还自动去重,union all 是不去重的。
PowerQuery中,对两列或者多列的计算一般通过添加自定义列来实现,以下表为例,
mysql 中查询重复数据
应用场景在自定义表单时采用自定义表名-自定义表字段-具体内容来实现,这就需要对数据表进行处理数据项设计思路及处理:数据项数据库设计采用数据唯一标识表-对应-数据表来实现
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M