Select informix 14.10如何;选择";返回特定短语,例如“无”或“空白”,而不是“无结果”
我有这样一个问题:Select informix 14.10如何;选择";返回特定短语,例如“无”或“空白”,而不是“无结果”,select,informix,Select,Informix,我有这样一个问题: select c1 , ( select d1 from table2 where dt) from table1 where ct --c1 d1 value1 NONE or Blank value 2 NONE or Blank . . . . 但是如果在条件dt下没有d1,我没有结果,但是我有一个像这样的reult: sele
select c1 , ( select d1 from table2 where dt) from table1 where ct
--c1 d1
value1 NONE or Blank
value 2 NONE or Blank
. .
. .
但是如果在条件dt下没有d1,我没有结果,但是我有一个像这样的reult:
select c1 , ( select d1 from table2 where dt) from table1 where ct
--c1 d1
value1 NONE or Blank
value 2 NONE or Blank
. .
. .
有人能帮忙吗?NVL函数可用于返回其两个参数中的任何一个,具体取决于第一个参数的计算结果是否为NULL。因此,您的示例查询可以写成:
select c1 , NVL(( select d1 from table2 where dt), "NONE") from table1 where ct
这两个参数的数据类型需要兼容,例如字符或数字。
有关更多信息,请访问