当前位置:网站首页>字段行相同则合并在另外一个字段sql 语句?
字段行相同则合并在另外一个字段sql 语句?
2022-04-21 12:25:00 【CSDN问答】
如图如果字段1 列相同,则把对应的 字段2 内容相加到字段3

非常感谢
sqlite mysql语句都可以
采纳答案:
有一个问题需要明确一下,字段三是你想要的结果是吗?不是本来就有的把,如果是这样,那么使用下面的语句就可以:
select 字段1,group_concat(字段2) from table_name group by 字段1
如果字段3本来就存在,那么就需要使用max将其取出,然后关联以上面的语句作为的子查询,concat拼接到一起就可以了。
版权声明
本文为[CSDN问答]所创,转载请带上原文链接,感谢
https://ask.csdn.net/questions/7691519
边栏推荐
- Is it difficult to choose binary version control tools? After reading this article, you will find the answer
- 【软件测试系列八】《软件项目测试报告》
- sublime主題配色
- [software test series vi] software system test scheme
- How does electron net send a post request
- Game industry case 2: player level
- AAAI2022|基于概率软逻辑的无偏时序常识知识推理
- Kubernetes service discovery monitoring apiserver
- Insert multiple pieces of data into the database in idea
- Three. JS learning project -- 3D data visualization of anti US aggression and aid Korea
猜你喜欢

华润怡宝被传IPO,农夫山泉或将迎来早年“宿敌”

S parameter introduction

Three. JS learning project -- 3D data visualization of anti US aggression and aid Korea

Berkeley, Samsung | a fast post training converter pruning framework

數據庫,把另一張錶某字段數據添加到另一個錶中,同時加入的時候加入自己需要的數據

国网上海直流充电桩专利公布:保证安全运行,全流程检测,分级运维

逆向爬虫30 某验四代滑块验证码

China Resources Yibao is rumored to have an IPO, and nongnongshanquan may usher in an early "old enemy"

Chinese character extraction operation of Sao package (string, no re, in)

集成公告|KeyFi现已上线Moonbeam
随机推荐
ASM插桩之美
China Resources Yibao is rumored to have an IPO, and nongnongshanquan may usher in an early "old enemy"
骚包的中文字符提取操作(字符串,不用 re ,用 in )
Insert multiple pieces of data into the database in idea
【软件测试系列一】《软件测试基础知识》
[Software Test Series VII] software test plan
逆波兰表达式
每日AI前沿术语:主动学习(Active Learning)
vscode 经常弹出:尝试在目标目录创建文件时发生一个错误 重试 跳过这个文件 关闭安装程序
How does electron net send a post request
R语言中实现随机森林建模的包randomForest
天梯赛题目记录(二)
Notepad + + how to copy multiple lines and paste them to the corresponding position
[Software Testing Series II] software testing process specification
Importer dans le tampon du Protocole
【数据可视化应用】绘制双变量映射地图(附R语言代码)
Intermediary encircles little red book
Machine learning-sklearn-13 (regression family - lower - nonlinear problem: polynomial regression (a new characteristic matrix is formed after polynomial transformation))
[software test series 12] stress test report template
R语言实现决策回归树的包rpart