如何将多行的列中的值从另一个表的一个单元格中获取? [英] How do I get values from a column for multiple rows into one cell for another table?

查看:94
本文介绍了如何将多行的列中的值从另一个表的一个单元格中获取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how do i get values from multiple cells for a column into one cell of another table.
I have tblAgenda and tblMeeting.
I want to have all agenda notes from Agenda Daily Note column of tblAgenda into Agenda Column which needs to be computed column on tblMeeting.







tblAgenda	 	 	 
AgendaID	MeetingID	Day	Agenda daiy Note
1	1	1	This Is day 1, First agenda.
2	1	1	This Is day 1, Second agenda.
3	1	2	This Is day 2,First agenda.
4	1	2	This Is day 2 , Second agenda.
5	1	2	This Is day 2, Third agenda.







tblMeeting	
ID	Agenda
1	This Is day 1, First agenda.This Is day 1, Second agenda.This Is day 2,First agenda.This Is day 2 , Second agenda.





我尝试了什么:



我只是初学者级别的MSSQL查询CRUD操作。所以我不知道如何实现这个目标?



What I have tried:

I only beginner level of MSSQL query for CRUD operation. So i do not know how to achieve this?

推荐答案

你好,

使用Concat



INSERT INTO tblMeeting(议程)

SELECT CONCAT([Day],',',[Agenda daiy Note])FROM tblAgenda
Hello,
Use Concat

INSERT INTO tblMeeting(Agenda)
SELECT CONCAT([Day],',',[Agenda daiy Note]) FROM tblAgenda


这篇关于如何将多行的列中的值从另一个表的一个单元格中获取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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