create table aa
(
 mytime char(5) not null check (translate(mytime,'0123456789:','9999999999:')='99:99' and to_number(replace(mytime,':'))<=2400)
)
/

解决方案 »

  1.   

    create table test(str varchar2(5),constraint check_test check
     (
      length(str)=5 and
      substr(str,3,1)=':' and 
      (
        (
          ((substr(str,1,2)>='00')and(substr(str,1,2)<'24')) and
          ((substr(str,4,2)>='00')and(substr(str,4,2)<='59'))
        )or
        ((substr(str,1,2)='24')and(substr(str,4,2)='00')) 
      )
     )
    )
      

  2.   

    刚才有错
    这样
    create table aa
    (
     mytime char(5) not null check (translate(mytime,'0123456789:','9999999999:')='99:99' and to_number(replace(mytime,':'))<=2400 and to_number(substrb(mytime,4,2))<=59)
    )
    /
      

  3.   

    去搜check约束,或者直接存date型
      

  4.   

    alter table test add constraint check_test check
    (
      length(str)=5 and
      substr(str,3,1)=':' and 
      (
        (
          ((substr(str,1,2)>='00')and(substr(str,1,2)<'24')) and
          ((substr(str,4,2)>='00')and(substr(str,4,2)<='59'))
        )or
        ((substr(str,1,2)='24')and(substr(str,4,2)='00')) 
      )
    )
      

  5.   

    CodeMagic(ErrorDetector) 是对的
    不过最好还是存为日期型.
      

  6.   

    啊,中间又多了一位啦,我说的二位是轻尘和CodeMagic(ErrorDetector),还有ATGC
      

  7.   

    呵呵。毕竟清楚比模糊好,现在我在研究楼上CodeMagic和ATGC两位大大的写法。这样也学到东西啊。唉。说实话。我现在连怎么看ORCALE的帮助都不知道啊。SQL就有查询帮助啊。但ORCALE不知道在哪看啊。(能告知吗^_^?谢谢)
      

  8.   

    网上下资料,给我email,我给你个资料,是英文的
      

  9.   

    有好书介绍吗?
    我的E-MAIL是:[email protected]
    谢谢你们啊。你们真好人~~谢谢!!!
      

  10.   

    电子工业出版社:完全接触Oracle
    机械工业出版社:Oracle 8/8i开发使用手册我现在就用这两本,另外你自己再到网上搜索搜索吧