create table aa
(
mytime char(5) not null check (translate(mytime,'0123456789:','9999999999:')='99:99' and to_number(replace(mytime,':'))<=2400)
)
/
(
mytime char(5) not null check (translate(mytime,'0123456789:','9999999999:')='99:99' and to_number(replace(mytime,':'))<=2400)
)
/
(
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'))
)
)
)
这样
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)
)
/
(
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'))
)
)
不过最好还是存为日期型.
我的E-MAIL是:[email protected]
谢谢你们啊。你们真好人~~谢谢!!!
机械工业出版社:Oracle 8/8i开发使用手册我现在就用这两本,另外你自己再到网上搜索搜索吧