下表是从另一个表创建的,其中包含 ID、Name、Organ 和 Age 列。在器官栏中找到的值是指定器官和状况的代码。
使用 CASE 我做了一个这样的表格:
--------------------------------------------------------
ID NAME Heart Brain Lungs Kidneys AGE
1318 Joe Smith NULL NULL NULL NULL 50
1318 Joe Smith NULL NULL NULL NULL 50
1318 Joe Smith NULL NULL NULL Below 50
1318 Joe Smith NULL NULL NULL Below 50
1318 Joe Smith NULL NULL Above NULL 50
1318 Joe Smith NULL NULL Above NULL 50
1318 Joe Smith Average NULL NULL NULL 50
1318 Joe Smith Average NULL NULL NULL 50 …Run Code Online (Sandbox Code Playgroud)