相当于mysql ifnull的oracle(无大小写,无if) [英] oracle equivalent of mysql ifnull (no case, no if)
本文介绍了相当于mysql ifnull的oracle(无大小写,无if)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种快速的方法
I am looking for a quick way to do
SELECT IFNULL(columna, columnb) FROM mytable
(我有几十个列,不想为每个列写一个案例)
(I have dozens of columns and don't want to write a case for each of them)
推荐答案
您还可以使用标准的COALESCE
关键字,该关键字允许您向其传递多个参数:
You can also use the standard COALESCE
keyword, which allows you to pass it multiple parameters:
SELECT COALESCE(columna, columnb, ..., columnz) FROM mytable
这篇关于相当于mysql ifnull的oracle(无大小写,无if)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文