我在执行select 语句时,想在null 字段显示出我想查询的数据,但是 出现了下面的错误
具体语句是select null from dualexpression must have same datatype as corresponding expression to_char(info_date, 'yyyy-mm-dd hh24:mi:ss')如果我想正常显示,怎么在null 做转换

解决方案 »

  1.   

    你执行的是什么语句?
    select null from dual是没问题的
    不过和你第一句说的好像沾不上边
    下面提示的to_char(info_date, 'yyyy-mm-dd hh24:mi:ss')是怎么回事
      

  2.   

    select case when info_date is null then 'yourinformation' else to_char(info_date, 'yyyy-mm-dd hh24:mi:ss') end info_date from table;
      

  3.   

    to 1楼 
    没有明白我说的,select null from dual 出现下面的错误,很明显,第一个字段的数据类型不对应啊.to 2楼谢谢,但是如果我想去掉所有的'符号,这样的语句怎么写.
      

  4.   

    的却看不懂楼主的意思
    nvl()么
      

  5.   

    就是不用'符号,也能完成正常的sql查询.    比如 'version'  这样的,  可以用char(118,101,114,115,105,111,110) 或者hex(0x76657273696F6E)  这样的转换来代替.上面的语句怎么转呢?用chr可以吗?