表table中有个clob型的字段data,如果data不为空,显示"有数据",否则显示"无数据",
尝试过用 select data(case data when null then "无数据" else "有数据" end) from table,报错信息为:数据类型不一致:应为-,但却获得CLOB,请问该如何查询?

解决方案 »

  1.   


    select decode(length(data),0,'无数据','有数据')
    from table
      

  2.   

    select decode(data,0,'无数据','有数据')
    from table
      

  3.   

    其实 也可以使用下面sql
    select  case when data is full then '无数据' else  '有数据' end  from table
      

  4.   

    select (case to_char(data) when '' then '无数据' else '有数据' end) from table