简体   繁体   English

如何以两个表的形式从存储过程中获取数据?

[英]How to get data from Stored Procedure in form of two tables?

I have two tables 1. Staff 2. Clients Each Staff has some Clients. 我有两个表1.员工2.客户每个员工都有一些客户。 I want to write an Stored Procedure that returns me staff name and it's clients name and Clients address. 我想编写一个存储过程,该存储过程返回我的员工姓名,客户名称和客户地址。 How can I achieve this? 我该如何实现? I want to make a report from the returned result which will be like this: 我想根据返回的结果进行报告,如下所示: 在此处输入图片说明

This staff has three clients and their addresses are being shown respectively. 该工作人员有三个客户,并且分别显示了他们的地址。 This is just an example. 这只是一个例子。 I can have more than one staff. 我可以有多个员工。 This report is in simple HTML, I have to make it in SQL Server Reporting Services. 该报告使用简单的HTML,我必须在SQL Server Reporting Services中进行报告。 Any help would be appreciated. 任何帮助,将不胜感激。

Create a query that joins the Staff and Client tables together, and in SSRS, group by the staff name. 创建一个将Staff和Client表连接在一起的查询,并在SSRS中按人员名称分组。 It's pretty simple to do. 这很简单。

HTH. HTH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在单个存储过程中从多个表中获取数据? - how to get data from multiple tables in a single stored procedure? 如何在一个控制器/JOIN 中从我的数据库返回/获取两个模型/表或使用存储过程 - How to return / GET two models/tables from my DB in one controller / JOIN or use stored procedure 存储过程返回两个表,如何将数据从模型移动到视图 - Stored procedure returns two tables how to move data from model to view 如何使用c#中的存储过程从网格中的两个表中获取数据 - how to get data from two table in the grid by using stored procedure in c# c#linq从存储过程中获取结果,该存储过程返回两个表之间的联接 - c# linq get result from stored procedure that returns a join between two tables 如何从SQL Server中的存储过程中获取数据 - How to Get Data from Stored Procedure in SQL Server 如何使用存储过程从 SQL Server 获取数据 - How to get data from SQL Server using a stored procedure 如何仅从存储过程中获取一组数据? - How to get only one set of data from my Stored Procedure? 如何从Entity Framework中的存储过程获取DataSet数据 - How to get data as DataSet from stored procedure in Entity Framework 从存储过程中获取数据时如何避免重复? - How to avoid repeating when I get data from stored procedure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM