存储过程视图问题 [英] Stored Procedure view problem

查看:83
本文介绍了存储过程视图问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b $bı有3个表,我写了sp,但我想更改存储过程的视图

http://c1302.hizliresim.com/16/m/k8gt7.png [ ^ ]



我想要存储过程''这个观点。如果我执行我的sp我想要这个sp'的观点。对不起我的英文:)



http:// c1302.hizliresim.com/16/m/k8gts.png [ ^ ]



help pls。

解决方案

您需要交叉表查询为了那个原因。在sqlserver中有一个名为PIVOT的工具/语句。它会在这种情况下帮助你。只需按照以下文章。希望您理解这个概念并根据需要实施。



sql-server-cross-tab-query-with-pivot

sql-server-pivot-examples

SQL服务器枢轴和 - 逆透视表-例子

Hi,
ı have 3 tables and i wrote sp but i want to change stored procedure''s view
http://c1302.hizliresim.com/16/m/k8gt7.png[^]

I want to stored procedure''s this view. if i exec my sp i want to this sp''s view. sorry for my english :)

http://c1302.hizliresim.com/16/m/k8gts.png[^]

help pls.

解决方案

You need cross tab query for that. In sqlserver has a tool/statement named PIVOT. It will help you in this context. Just follow the following articles. Hope you understand that concept and implement that as your need.

sql-server-cross-tab-query-with-pivot
sql-server-pivot-examples
sql-server-pivot-and-unpivot-table-examples


这篇关于存储过程视图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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