1、建立測試表,
create table test_isnum(id number, value varchar2(20));
2、插入測試資料,
insert into test_isnum values(1,"a");
insert into test_isnum values(2,329);
insert into test_isnum values(4,"15");
insert into test_isnum values(6,"2c");
commit;
3、查詢表中所有記錄,select t.*, rowid from test_isnum t,
4、編寫sql,判斷value欄位,記錄為數字的內容,
select t.*,
case
when not regexp_like(value, "\D") then
"是"
else
"否"
end as "是否數字"
from test_isnum t;
1、建立測試表,
create table test_isnum(id number, value varchar2(20));
2、插入測試資料,
insert into test_isnum values(1,"a");
insert into test_isnum values(2,329);
insert into test_isnum values(4,"15");
insert into test_isnum values(6,"2c");
commit;
3、查詢表中所有記錄,select t.*, rowid from test_isnum t,
4、編寫sql,判斷value欄位,記錄為數字的內容,
select t.*,
case
when not regexp_like(value, "\D") then
"是"
else
"否"
end as "是否數字"
from test_isnum t;