【发布时间】:2020-12-22 04:30:33
【问题描述】:
我有一个独特的表,其中包含同一列中的人员和组织混合的数据,只有一个只有 1 个字母的字段设置数据引用。
例子
id|type | surname of person/organization | name of person/address of organization | person sex/organization fiscal code
1| P | GATES | BILL | M
2| O | GOOGLE | PALO ALTO | 04340349204920
3| P | DOE | JENNIFER | F
...etc....
我想在 Postgres 中创建一个按引用类型(字母)组织和分隔信息的视图,像这样
id|type|surname|name |sex|organization|address |fiscal code
1| P | GATES | BILL | M | | |
2| O | | | | GOOGLE | PALO ALTO | 04340349204920
3| P | DOE | JENNIFER | F | | |
我认为这应该很简单(对我来说),但我卡住了。
【问题讨论】:
标签: sql postgresql case sql-view