• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

19. Some Common Data Manipulation Problems > 19.8. Vertical to Horizontal

Vertical to Horizontal

Imagine a database of personal statistics with two tables (Table 19-14 and Table 19-15).

Table 19-14. Composers table

EmpID

Name

1

Beethoven

2

Chopin

3

Mozart

4

Schubert

5

Brahms

6

Liszt

Notice that Table 19-15 has one row per statistic. Thus, the data for an individual person is arranged vertically. Notice also that some data is missing. For instance, there is no data at all for Liszt.

Table 19-15. ComposersData table

EmpID

StatType

Value

1

Age

45

1

Height

63

1

Weight

150

2

Age

46

2

Height

67

3

Age

35

3

Weight

135

4

Age

44

5

Height

76

Now, we want to view the data horizontally, as in Table 19-16.

Table 19-16. Combination of Table 19-14 and Table 19-15

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint