数据库透视 - 目的是什么? [英] Database Pivoting - what is the purpose?

查看:23
本文介绍了数据库透视 - 目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Why would someone want to convert columns into rows (ie pivoting)? Which problem does it solve?

I found some links, but did not get satisfactory answers to the questions.

http://codeghar.wordpress.com/2007/11/03/pivot-tables/

http://msdn.microsoft.com/en-us/library/ms177410%28SQL.105%29.aspx

解决方案

Usually, it's because the layout works better in a report, or user interface after pivoting.

Data on a normalized database may result in data in the "shape" of multiple records, where the UI wants to see those records as fields. Data normalization is great, but when it comes to representing data in a concise, natural format, pivoting is often necessary.

example here.

Granted, the example I linked to is Excel, not a true DB, but the pictures describe an example of where the pivoted data looks more natural, and the concept is the same.

这篇关于数据库透视 - 目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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