每个联系人有手机、家庭、办公三个电话字段。按 mobile → home → office 的优先级,取第一个不为 null 的号码作为 phone。
- 三个字段都是 null 时,
phone为 null。 - 空字符串
""不是 null,它就是一个“非空值”,会被选中。
输入
contacts(id, mobile, home, office),三个电话字段都是字符串。
输出
列为 id, phone,每个联系人一行,行顺序不限。
每个联系人有手机、家庭、办公三个电话字段。按 mobile → home → office 的优先级,取第一个不为 null 的号码作为 phone。
phone 为 null。"" 不是 null,它就是一个“非空值”,会被选中。输入
contacts(id, mobile, home, office),三个电话字段都是字符串。输出
列为 id, phone,每个联系人一行,行顺序不限。
contacts local/base/contacts
| # | idint64 | mobilestring | homestring | officestring |
|---|---|---|---|---|
| 1 | 1 | 13800000001 | 010-1111 | 010-9001 |
| 2 | 2 | null | 010-2222 | 010-9002 |
| 3 | 3 | null | null | 010-9003 |
| 4 | 4 | 13800000004 | null | null |
| 5 | 5 | null | 010-5555 | null |
| 6 | 6 | 13800000006 | 010-6666 | 010-9006 |
| 7 | 7 | null | null | null |
| 8 | 8 | 13800000008 | null | 010-9008 |
| # | idInt64 | phoneString |
|---|---|---|
| 1 | 1 | 13800000001 |
| 2 | 2 | 010-2222 |
| 3 | 3 | 010-9003 |
| 4 | 4 | 13800000004 |
| 5 | 5 | 010-5555 |
| 6 | 6 | 13800000006 |
| 7 | 7 | null |
| 8 | 8 | 13800000008 |