sql - 具有空行的 SQL Server 中的 CASE
问题描述
SQL Server 和堆栈中的新功能。这是我的第一个问题,如果有问题请帮我纠正
我希望能够共享整个查询,因为它太大但下面是我的最终输出
personno personcat answervale personno personcat answervale
-----------------------------------------------------------
12 1 yes null null null
12 2 no 12 1 test
null null null 12 2 check
但我想安排这个最终输出
personcat personno answervale personcat personno answervale
------------------------------------------------------------
1 12 yes 1 12 test
personcat personno answervale personcat personno answervale
2 12 no 2 12 check
如上所述,我只需要两行,但我得到所有答案的行
我尝试过的事情:
基于personcat的案例
我在 where 使用 union added personcat 但仍然没有得到预期的输出
如果有人可以提出其他方法来获得预期的输出 - 请帮助
提前致谢。
解决方案
推荐阅读
- python - Python Selenium:如何获取嵌套的 iframe 内容?
- python - url不变时的Python网页抓取
- flutter - 达到最大线时如何使 TextField 停止接收输入?
- c# - 获取 .NET Reactor 的 HWID
- rxjs - 从不断增长的数组中重复发出值
- git - 无法提交项目并将其推送到 GitHub
- c# - 分组,首先在 MongoDb C# 驱动程序中抛出 NotSupportedException
- javascript - 从 8 到 9 的 Angular 更新给测试框架带来了问题
- java - java tar 和 gzip 目录,但最终结果不是 .tar.gz 格式,结果只是一个普通文件
- ruby-on-rails - How can I use a Custom Channel of Action Cable with Stimulus Reflex and View Component?