我正在尝试运行如下所示的代码。这里的子查询从与主查询相同的表中提取 - 唯一的约束是 column3 is/is not NULL。有什么办法可以简化吗?
SELECT a.column1, a.column2, b.column1, b.column2
FROM table1 a
INNER JOIN
(SELECT column1, column2
FROM table1
WHERE column3 IS NULL) b
ON a.column4 = b.column4
WHERE a.column3 IS NOT NULL
GROUP BY a.column1, a.column2, b.column1, b.column2