check语句如何写呢,有木有default <> '***'的语法呢

解决方案 »

  1.   


    create table t1 (id varchar2(10),score number(10) check(score >=0 and score<=100));
    --类似这么写
      

  2.   

    -- Create table
    create table TEST_01
    (
      SS VARCHAR2(1000)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );
    -- Create/Recreate check constraints 
    alter table TEST_01
      add constraint CHE_TEST
      check (ss<>'1111');
      

  3.   

    alter table TEST_01
      add constraint CHE_TEST
      check (ss<>'1111');
    ----------增加一个约束,让列SS不等于1111