步骤1 create table table1 (uID int,CRTime date);
步骤2 insert into table1 (uID) values (1);
步骤3 select case CRTime when null then sysdate else CRTime end from table1;但是步骤3取不到sysdate的值?请问应如何取?谢谢

解决方案 »

  1.   

    create table t(cdate date default sysdate);-- 一般:默认取当前日期
      

  2.   

    alter table table1 modify CRTime default sysdate;
      

  3.   

    步骤3:
    select case when CRTime is null then sysdate else CRTime end from table1;
      

  4.   

     换成这样吧
    select NVL(CRTime,SYSDATE) from table1;
      

  5.   


      1* select case  when CRTime is null then sysdate else CRTime end from table1
    SQL> /CASEWHENCRTIME
    --------------
    20-7月 -10SQL> select nvl(CRTime,sysdate) from table1;NVL(CRTIME,SYS
    --------------
    20-7月 -10