1. 学ぶ
  2. /
  3. コース
  4. /
  5. 中級 SQL Server

Connected

演習

CASE で複数のグループを作成する

この演習では、DurationSeconds の値を次の範囲に基づいて5つのグループに分ける CASE ステートメントを書きます。

DurationSeconds SecondGroup
<= 120 1
> 120 and <= 600 2
> 600 and <= 1200 3
> 1201 and <= 5000 4
For all other values 5

指示

100 XP

上記の範囲に基づき、DurationSeconds 列の値を使用して新しい列 SecondGroup を作成してください。