表記件、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, ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する