表記件、Teradataで横持ちテーブルを縦持ちにする際の関数、反対に縦持ちテーブルを横持ちにする際の関数を使ってみました。まずは以下のような横持ちテーブルを用意します。 作成SQLは以下の通りです。 続いて、縦持ちされたデータを横持ちに戻します。
Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output should consist of four columns (Doctor, ...