轮换sql表 [英] Rotating sql table
本文介绍了轮换sql表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的sql表结构如下
F1 F2 F3 F4 F5
Group 1 2 3 4
Design 5 6 7 8
现在我想阅读此内容并返回如下所示的查询结果,请帮忙
now i want to read this and return a query result as show below please help
F1 Value
Group 1
Group 2
Group 3
Group 4
Design 5
Design 6
Design 7
Design 8
推荐答案
SQL 2005 引入了 pivot 和匹配的 unpivot 子句,如果您无法修复底层架构,这看起来像是一个主要情况
SQL 2005 Introduced a pivot and matching unpivot clause, and this looks like a prime case, if you're unable to fix the underlying schema
这篇关于轮换sql表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文