sql - 不能按数据分组
问题描述
输入
A B date
--------------------
00 12 22-01-2019
00 12 null
00 25 22-01-2019
00 24 22-01-2019
根据上述数据,我需要以下输出:
A B date
--------------------
00 12 null
00 25 22-01-2019
00 24 22-01-2019
我需要从表中获取打开、关闭的记录。
如果我使用的日期为空,则不会出现其他现有记录。
我需要在 B 列中应用条件。
如果 Column B 列的 date 中有 null 值,则 null 将显示,否则如果 null 和非 null 值都为 null,则将输出 date null。
Select a,b,date
from table1,table2
where ...
group by a,b,date
解决方案
推荐阅读
- google-sheets - 如何在一张纸上找到东西并将其添加到另一张纸上?
- android - 为什么在 Android 中不推荐根据当前时间自动切换主题?
- c# - 动态插入一行到要回发的表格中间以进行模型绑定
- excel - Excel VBA - UDF 返回 0 或空或 #value
- wordpress - WordPress - 主机通过 FTP 或 sFTP 将目录上传到远程服务器
- javascript - 如何在 Vue.js 中使用图像作为按钮?
- php - 在第 18 行调用 public_html/wp-content/themes/g5-beyot/header.php 中未定义的函数 g5plus_get_option()
- echarts - 鼠标离开图表区域时如何停止画笔拖动
- android - 当应用程序暂停需要建议时,android workmanager 不工作
- python-3.x - python文件中的2to3 ParseError