【发布时间】:2021-08-24 06:24:31
【问题描述】:
我希望我的查询会在每列给出 YES 时给我类型列表。
表格如下:
a b c d no
yes null yes null 1
null yes yes null 2
yes null null yess 3
查询的期望结果:
no type
1 a
1 c
2 b
2 c
3 a
3 d
我应该如何编写查询以获得预期结果?
提前致谢。
【问题讨论】:
标签: sql postgresql filter case-when