我在ORACLE下正常使用nvl函数,在derby下却不能用,请问在derby下用怎么实现nvl的功能?

解决方案 »

  1.   

    derby?这个是什么玩意,没有见过!order by nvl(字段,0)  --这样子OK!
      

  2.   

    nvl函数是oracle特有的
    java开源数据库啊,没用过
      

  3.   

    derby是jdk6.0自带的,自己的电脑上用还是不错的,空间小,功能不弱
      

  4.   

    sql server --> IsNull()
      

  5.   

    我想知道,derby怎么实现nvl函数相似的功能.
      

  6.   

    帮你找到了,
    TRY
    NULLIF(V1,V2)
      

  7.   

    原文:NULLIF expressions
    Use the NULLIF expressions for conditional expressions in Derby.NULLIF expression syntax
    NULLIF ( L, R )
    The NULLIF expression is very similar to the CASE expression. For example: 
    NULLIF(V1,V2)
    is equivalent to the following CASE expression:
    CASE WHEN V1=V2 THEN NULL ELSE V1 END
      

  8.   

    好象不对.看这句NULLIF(V1,V2) 
    is equivalent to the following CASE expression: 
    CASE WHEN V1=V2 THEN NULL ELSE V1 END
      

  9.   

    用CASE WHEN 去做吧.case when col is null then '指定值' else col end ;同样的效果.