在一列中连接多个记录 [英] concat multiple record in one column

查看:69
本文介绍了在一列中连接多个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个桌子
1名员工(emp_id,emp_name)值(1,"ahmed mohamed")




2-attach_emp(emp_id [f.k],attach_id [f.k])联结表

值(1,1)
值(1,2)






3-attachment(attach_id,attachname)
值(1,"a")
values(2,"b")

我希望结果是


emp_id___emp_name___Attachment
1___ahmed穆罕默德___ a,b
如何执行此操作并在记录之间进行连接

i have three table
1-employee(emp_id,emp_name) values(1,"ahmed mohamed")




2-attach_emp(emp_id [f.k] ,attach_id[f.k]) junction table

values(1,1)
values(1,2)






3-attachment(attach_id,attachname)
values(1,"a")
values(2,"b")

i want the result to be


emp_id___emp_name___Attachment
1___ahmed mohamed___a,b
how to do this join and concate between records

推荐答案

我相信^ ]提供您所需要的.
I believe this[^] provides what you need.


此处提供了类似的解决方案
http://stackoverflow.com/questions/194852/concatenate-many- rows-into-a-single-text-string [ ^ ]
我认为这可能对您有所帮助.
A similar solution is given here
http://stackoverflow.com/questions/194852/concatenate-many-rows-into-a-single-text-string[^]
I think it may be helpful to you.


这篇关于在一列中连接多个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆