当前位置:  开发笔记 > 数据库 > 正文

SQL nvl等价 - 没有if/case语句&isnull&coalesce

如何解决《SQLnvl等价-没有if/case语句&isnull&coalesce》经验,为你挑选了1个好方法。

SQL中是否有任何nvl()等效函数?

或者在某些情况下足够接近以相同方式使用的东西?


更新:
否if语句
没有case语句
no isnull
no coalesce

select nvl (purge_date,"SODIUFOSDIUFSDOIFUDSF") from id_rec where id=36581;


(expression)

SODIUFOSDIUFSDOIFUDSF

1 row(s) retrieved.

select isnull (purge_date,"SODIUFOSDIUFSDOIFUDSF") from id_rec where id=36581;

  674: Routine (isnull) can not be resolved.
Error in line 1
Near character position 8

select coalesce (purge_date,"SODIUFOSDIUFSDOIFUDSF") from id_rec where id=36581;

  674: Routine (coalesce) can not be resolved.
Error in line 1
Near character position 8

select decode(purge_date, NULL, "01/01/2009", purge_date) from id_rec where id=74115;

  800: Corresponding types must be compatible in CASE expression.
Error in line 1
Near character position 57

BradC.. 5

ISNULL(单个替换)

要么

COALESCE(返回其参数中的第一个非空表达式.)



1> BradC..:

ISNULL(单个替换)

要么

COALESCE(返回其参数中的第一个非空表达式.)

推荐阅读
kikokikolove
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有