我想在3个表格中选择一些列。我对此ORDER BY NULLS FIRST有问题。它已经2个小时了,并且仍在加载中。我认为我的脚本有误或需要添加一些内容。这是我的脚本,正在运行。
SELECT (CASE WHEN a.column1 IS NULL
THEN 'ACTIVE'
ELSE 'INACTIVE'
END) as STATUS_DEF, <<some columns>>,
(CASE WHEN b.column1 IS NULL
THEN 'Active'
ELSE) as STATUS_fnd_user, <<some columns>>,
c.column1||','||c.column2||','||c.column3
FROM table1 a, table2 b, table3 c
然后我想按Active First对其进行排序,这就是为什么我使用ORDER BY NULLS FIRST的原因。我试过了..
ORDER BY a.column1, b.column1 NULLS FIRST;
还有其他想法吗?
感谢a_horse_with_no_name :)
积极的...
FROM table1 a JOIN table2 b ON a.column1 IS NULL JOIN table3 c ON b.column1 IS NULL
无效...
FROM table1 a JOIN table2 b ON a.column1 = a.column1 JOIN table3 c ON b.column1 = b.column1
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句