
If a client were to provide you with unnormalized data, such as a budget spreadsheet with the months running across the top and
the amounts going down the left side, then you can use the UNPIVOT command to normalize the data.
| Unnormalized data - query |
| RESULTSET |
| Unnormalized data - query |
| |
DESCRIPTION |
MONTH1 |
MONTH10 |
MONTH11 |
MONTH12 |
MONTH2 |
MONTH3 |
MONTH4 |
MONTH5 |
MONTH6 |
MONTH7 |
MONTH8 |
MONTH9 |
| 1 |
Home |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
1000 |
| 2 |
Car |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
100 |
| 3 |
Candy |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
|
| CACHED |
false |
| EXECUTIONTIME |
62 |
| SQL |
select * from Budget |
| Code |
Budgetted Amount |
| Month1 |
1000 |
| Month2 |
1000 |
| Month3 |
1000 |
| Month4 |
1000 |
| Month5 |
1000 |
| Month6 |
1000 |
| Month7 |
1000 |
| Month8 |
1000 |
| Month9 |
1000 |
| Month10 |
1000 |
| Month11 |
1000 |
| Month12 |
1000 |
| Month1 |
100 |
| Month2 |
100 |
| Month3 |
100 |
| Month4 |
100 |
| Month5 |
100 |
| Month6 |
100 |
| Month7 |
100 |
| Month8 |
100 |
| Month9 |
100 |
| Month10 |
100 |
| Month11 |
100 |
| Month12 |
100 |
| Month1 |
10 |
| Month2 |
10 |
| Month3 |
10 |
| Month4 |
10 |
| Month5 |
10 |
| Month6 |
10 |
| Month7 |
10 |
| Month8 |
10 |
| Month9 |
10 |
| Month10 |
10 |
| Month11 |
10 |
| Month12 |
10 |
Also check out: CFM Zen Garden, and
jQuery Zen Garden.
Database: Phillip Senn
Design: Ryan Carroll