SQL Server存储过程可水平显示结果集 [英] SQL Server stored procedure to horiztonal display a result set
问题描述
我有下表:
分配表(assignID,assignName,点数)
表分配点表(assignid,studentid,分数)
我想按以下表格格式显示它们
studentid,assginname1,assignname2,assigname3等总计
1,90,80,90等
我该如何了解数据透视表,但无法在上述Senario中实现.
我正在使用SQL Server 2008和Coldfusion
我想创建一个存储过程,该存储过程将以前面提到的格式产生以下结果集
I have the following tables:
assign table (assignID, assignName, points)
table assignpoint table (assignid, studentid, score)
I want to display them in table format as follows
studentid ,assginname1, assignname2, assigname3, etc. total
1 , 90, 80, 90, etc.
How can I do that I know about pivot tables but i can not implement it in my senario mentioned above.
I am using SQL server 2008 and coldfusion
I want to create a stored procedure that will produce the following result set in the format mentioned before
推荐答案
,而无需使用 ^ ]我没有可行的方法
Without using PIVOT[^] there is no viable way I know of
这篇关于SQL Server存储过程可水平显示结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!